Added BSD fortune command (currently samples only from computer fortunes)
This commit is contained in:
+5733
File diff suppressed because it is too large
Load Diff
@@ -255,6 +255,14 @@ async def on_message(message: nextcord.Message):
|
|||||||
ongoing_races.pop(message.channel.id)
|
ongoing_races.pop(message.channel.id)
|
||||||
await message.channel.send(f"**Time's up!**\nThe answer was **{text}**.")
|
await message.channel.send(f"**Time's up!**\nThe answer was **{text}**.")
|
||||||
|
|
||||||
|
@bot.slash_command()
|
||||||
|
async def fortune(interaction: nextcord.Interaction):
|
||||||
|
await interaction.response.defer()
|
||||||
|
with open("fortune.txt") as f:
|
||||||
|
data = f.read()
|
||||||
|
data = data.split("\n%\n")
|
||||||
|
await interaction.send(f"```{random.choice(data)}```")
|
||||||
|
|
||||||
with open("token.txt") as f:
|
with open("token.txt") as f:
|
||||||
token = f.read()
|
token = f.read()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user