diff options
| author | 2021-09-04 23:31:14 -0400 | |
|---|---|---|
| committer | 2021-09-04 23:31:14 -0400 | |
| commit | 3377e46dc890626a29b05e134799b6219598107b (patch) | |
| tree | bdb4a2c6efbe113ec0e355a9eff5070cc8ec52aa /bot/exts/halloween/halloweenify.py | |
| parent | Move Easter to Holidays Folder (diff) | |
Move Halloween to Holidays folder
Moves all the hallowen features to the holidays folder.
Also updates the paths to reflect the folder moves.
Diffstat (limited to 'bot/exts/halloween/halloweenify.py')
| -rw-r--r-- | bot/exts/halloween/halloweenify.py | 64 | 
1 files changed, 0 insertions, 64 deletions
diff --git a/bot/exts/halloween/halloweenify.py b/bot/exts/halloween/halloweenify.py deleted file mode 100644 index 83cfbaa7..00000000 --- a/bot/exts/halloween/halloweenify.py +++ /dev/null @@ -1,64 +0,0 @@ -import logging -from json import loads -from pathlib import Path -from random import choice - -import discord -from discord.errors import Forbidden -from discord.ext import commands -from discord.ext.commands import BucketType - -from bot.bot import Bot - -log = logging.getLogger(__name__) - -HALLOWEENIFY_DATA = loads(Path("bot/resources/halloween/halloweenify.json").read_text("utf8")) - - -class Halloweenify(commands.Cog): -    """A cog to change a invokers nickname to a spooky one!""" - -    @commands.cooldown(1, 300, BucketType.user) -    @commands.command() -    async def halloweenify(self, ctx: commands.Context) -> None: -        """Change your nickname into a much spookier one!""" -        async with ctx.typing(): -            # Choose a random character from our list we loaded above and set apart the nickname and image url. -            character = choice(HALLOWEENIFY_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 " -            ) -            embed.set_image(url=image) - -            if isinstance(ctx.author, discord.Member): -                try: -                    await ctx.author.edit(nick=nickname) -                    embed.description += f"Your new nickname will be: \n:ghost: **{nickname}** :jack_o_lantern:" - -                except Forbidden:   # The bot doesn't have enough permission -                    embed.description += ( -                        f"Your new nickname should be: \n :ghost: **{nickname}** :jack_o_lantern: \n\n" -                        f"It looks like I cannot change your name, but feel free to change it yourself." -                    ) - -            else:   # The command has been invoked in DM -                embed.description += ( -                    f"Your new nickname should be: \n :ghost: **{nickname}** :jack_o_lantern: \n\n" -                    f"Feel free to change it yourself, or invoke the command again inside the server." -                ) - -        await ctx.send(embed=embed) - - -def setup(bot: Bot) -> None: -    """Load the Halloweenify Cog.""" -    bot.add_cog(Halloweenify())  |