diff options
Diffstat (limited to 'bot/seasons/halloween/halloweenify.py')
| -rw-r--r-- | bot/seasons/halloween/halloweenify.py | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/bot/seasons/halloween/halloweenify.py b/bot/seasons/halloween/halloweenify.py index ce057889..dfcc2b1e 100644 --- a/bot/seasons/halloween/halloweenify.py +++ b/bot/seasons/halloween/halloweenify.py @@ -13,32 +13,31 @@ log = logging.getLogger(__name__) class Halloweenify(commands.Cog): """A cog to change a invokers nickname to a spooky one!""" - def __init__(self, bot): + def __init__(self, bot: commands.Bot): self.bot = bot @commands.cooldown(1, 300, BucketType.user) @commands.command() - async def halloweenify(self, ctx): - """Change your nickname into a much spookier one.""" - + async def halloweenify(self, ctx: commands.Context) -> None: + """Change your nickname into a much spookier one!""" async with ctx.typing(): - with open(Path('bot', 'resources', 'halloween', 'halloweenify.json'), 'r') as f: + with open(Path("bot/resources/halloween/halloweenify.json"), "r") as f: data = load(f) # Choose a random character from our list we loaded above and set apart the nickname and image url. - character = choice(data['characters']) + character = choice(data["characters"]) nickname = ''.join([nickname for nickname in character]) image = ''.join([character[nickname] for nickname in character]) # Build up a Embed embed = discord.Embed() embed.colour = discord.Colour.dark_orange() - embed.title = 'Not spooky enough?' + embed.title = "Not spooky enough?" embed.description = ( - f'**{ctx.author.display_name}** wasn\'t spooky enough for you? That\'s understandable, ' - f'{ctx.author.display_name} isn\'t scary at all! ' - 'Let me think of something better. Hmm... I got it!\n\n ' - f'Your new nickname will be: \n :ghost: **{nickname}** :jack_o_lantern:' + f"**{ctx.author.display_name}** wasn\'t spooky enough for you? That\'s understandable, " + f"{ctx.author.display_name} isn\'t scary at all! " + "Let me think of something better. Hmm... I got it!\n\n " + f"Your new nickname will be: \n :ghost: **{nickname}** :jack_o_lantern:" ) embed.set_image(url=image) @@ -47,8 +46,7 @@ class Halloweenify(commands.Cog): await ctx.send(embed=embed) -def setup(bot): +def setup(bot: commands.Bot) -> None: """Halloweenify Cog load.""" - bot.add_cog(Halloweenify(bot)) log.info("Halloweenify cog loaded") |