aboutsummaryrefslogtreecommitdiffstats
path: root/bot/cogs/hacktober/halloweenify.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/cogs/hacktober/halloweenify.py')
-rw-r--r--bot/cogs/hacktober/halloweenify.py43
1 files changed, 23 insertions, 20 deletions
diff --git a/bot/cogs/hacktober/halloweenify.py b/bot/cogs/hacktober/halloweenify.py
index 9b93ac99..5d270974 100644
--- a/bot/cogs/hacktober/halloweenify.py
+++ b/bot/cogs/hacktober/halloweenify.py
@@ -21,26 +21,29 @@ class Halloweenify:
"""
Change your nickname into a much spookier one!
"""
- 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'])
- 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.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:'
- )
- embed.set_image(url=image)
-
- await ctx.author.edit(nick=nickname)
+ async with ctx.typing():
+ 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'])
+ 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.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:'
+ )
+ embed.set_image(url=image)
+
+ await ctx.author.edit(nick=nickname)
+
await ctx.send(embed=embed)