diff options
| -rw-r--r-- | bot/seasons/halloween/8ball.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/bot/seasons/halloween/8ball.py b/bot/seasons/halloween/8ball.py index 750b489f..de30fa78 100644 --- a/bot/seasons/halloween/8ball.py +++ b/bot/seasons/halloween/8ball.py @@ -1,4 +1,5 @@ import asyncio +import discord import json import logging import random @@ -13,27 +14,29 @@ with open(Path('bot', 'resources', 'halloween', 'responses.json'), 'r', encoding class EightBall(commands.Cog): - """Spooky Eightball - upon use of the command the user receives a randomised response to their question!""" + """Spooky Eightball answers.""" def __init__(self, bot): self.bot = bot @commands.command(aliases=('spooky8ball',)) - async def spookyeightball(self, ctx, question: str): + async def spookyeightball(self, ctx, *, question: str): """Responds with a random response to a question.""" - - choice = random.choice(responses) + choice = random.choice(responses['responses']) if len(choice) == 1: await ctx.send(choice[0]) else: - for x in choice: - await ctx.send(x) - asyncio.sleep(random.randint(2, 5)) - await ctx.send(x) + emb = discord.Embed(colour=0x00f2ff) + emb.add_field(name=f'Question from {ctx.author.name}', value=question) + emb.add_field(name='Answer', value=choice[0]) + msg = await ctx.send(embed=emb) + await asyncio.sleep(random.randint(2, 5)) + emb.set_field_at(1, name='Answer', value=f'{choice[0]} \n {choice[1]}') + await msg.edit(embed=emb) def setup(bot): - """Conversation starters Cog load.""" + """Spooky Eight Ball Cog Load.""" bot.add_cog(EightBall(bot)) log.info("8Ball cog loaded") |