diff options
Diffstat (limited to 'bot/exts/holidays/halloween')
| -rw-r--r-- | bot/exts/holidays/halloween/8ball.py | 4 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/candy_collection.py | 9 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/halloween_facts.py | 4 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/halloweenify.py | 4 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/monsterbio.py | 4 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/monstersurvey.py | 4 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/scarymovie.py | 4 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/spookygif.py | 6 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/spookynamerate.py | 9 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/spookyrating.py | 4 | ||||
| -rw-r--r-- | bot/exts/holidays/halloween/spookyreact.py | 7 |
11 files changed, 27 insertions, 32 deletions
diff --git a/bot/exts/holidays/halloween/8ball.py b/bot/exts/holidays/halloween/8ball.py index 4fec8463..21b55a01 100644 --- a/bot/exts/holidays/halloween/8ball.py +++ b/bot/exts/holidays/halloween/8ball.py @@ -26,6 +26,6 @@ class SpookyEightBall(commands.Cog): await msg.edit(content=f"{choice[0]} \n{choice[1]}") -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Spooky Eight Ball Cog.""" - bot.add_cog(SpookyEightBall()) + await bot.add_cog(SpookyEightBall()) diff --git a/bot/exts/holidays/halloween/candy_collection.py b/bot/exts/holidays/halloween/candy_collection.py index 220ba8e5..683114f9 100644 --- a/bot/exts/holidays/halloween/candy_collection.py +++ b/bot/exts/holidays/halloween/candy_collection.py @@ -88,10 +88,7 @@ class CandyCollection(commands.Cog): if message.author.bot: return - recent_message_ids = map( - lambda m: m.id, - await self.hacktober_channel.history(limit=10).flatten() - ) + recent_message_ids = [message.id async for message in self.hacktober_channel.history(limit=10)] if message.id in recent_message_ids: await self.reacted_msg_chance(message) return @@ -214,6 +211,6 @@ class CandyCollection(commands.Cog): await ctx.send(embed=e) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Candy Collection Cog.""" - bot.add_cog(CandyCollection(bot)) + await bot.add_cog(CandyCollection(bot)) diff --git a/bot/exts/holidays/halloween/halloween_facts.py b/bot/exts/holidays/halloween/halloween_facts.py index adde2310..a0d63f64 100644 --- a/bot/exts/holidays/halloween/halloween_facts.py +++ b/bot/exts/holidays/halloween/halloween_facts.py @@ -50,6 +50,6 @@ class HalloweenFacts(commands.Cog): return discord.Embed(title=title, description=fact, color=PUMPKIN_ORANGE) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Halloween Facts Cog.""" - bot.add_cog(HalloweenFacts()) + await bot.add_cog(HalloweenFacts()) diff --git a/bot/exts/holidays/halloween/halloweenify.py b/bot/exts/holidays/halloween/halloweenify.py index 03b52589..a16ea6cc 100644 --- a/bot/exts/holidays/halloween/halloweenify.py +++ b/bot/exts/holidays/halloween/halloweenify.py @@ -59,6 +59,6 @@ class Halloweenify(commands.Cog): await ctx.send(embed=embed) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Halloweenify Cog.""" - bot.add_cog(Halloweenify()) + await bot.add_cog(Halloweenify()) diff --git a/bot/exts/holidays/halloween/monsterbio.py b/bot/exts/holidays/halloween/monsterbio.py index 0556a193..8e83e9d1 100644 --- a/bot/exts/holidays/halloween/monsterbio.py +++ b/bot/exts/holidays/halloween/monsterbio.py @@ -49,6 +49,6 @@ class MonsterBio(commands.Cog): await ctx.send(embed=embed) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Monster Bio Cog.""" - bot.add_cog(MonsterBio()) + await bot.add_cog(MonsterBio()) diff --git a/bot/exts/holidays/halloween/monstersurvey.py b/bot/exts/holidays/halloween/monstersurvey.py index f3433886..517f1bcb 100644 --- a/bot/exts/holidays/halloween/monstersurvey.py +++ b/bot/exts/holidays/halloween/monstersurvey.py @@ -200,6 +200,6 @@ class MonsterSurvey(Cog): await ctx.send(embed=embed) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Monster Survey Cog.""" - bot.add_cog(MonsterSurvey()) + await bot.add_cog(MonsterSurvey()) diff --git a/bot/exts/holidays/halloween/scarymovie.py b/bot/exts/holidays/halloween/scarymovie.py index 89310b97..74bcef90 100644 --- a/bot/exts/holidays/halloween/scarymovie.py +++ b/bot/exts/holidays/halloween/scarymovie.py @@ -120,6 +120,6 @@ class ScaryMovie(commands.Cog): return embed -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Scary Movie Cog.""" - bot.add_cog(ScaryMovie(bot)) + await bot.add_cog(ScaryMovie(bot)) diff --git a/bot/exts/holidays/halloween/spookygif.py b/bot/exts/holidays/halloween/spookygif.py index 9511d407..750e86ca 100644 --- a/bot/exts/holidays/halloween/spookygif.py +++ b/bot/exts/holidays/halloween/spookygif.py @@ -25,7 +25,7 @@ class SpookyGif(commands.Cog): # Make a GET request to the Giphy API to get a random halloween gif. async with self.bot.http_session.get(API_URL, params=params) as resp: data = await resp.json() - url = data["data"]["image_url"] + url = data["data"]["images"]["downsized"]["url"] embed = discord.Embed(title="A spooooky gif!", colour=Colours.purple) embed.set_image(url=url) @@ -33,6 +33,6 @@ class SpookyGif(commands.Cog): await ctx.send(embed=embed) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Spooky GIF Cog load.""" - bot.add_cog(SpookyGif(bot)) + await bot.add_cog(SpookyGif(bot)) diff --git a/bot/exts/holidays/halloween/spookynamerate.py b/bot/exts/holidays/halloween/spookynamerate.py index 02fb71c3..a76e5e12 100644 --- a/bot/exts/holidays/halloween/spookynamerate.py +++ b/bot/exts/holidays/halloween/spookynamerate.py @@ -95,8 +95,6 @@ class SpookyNameRate(Cog): self.bot = bot self.name = None - self.bot.loop.create_task(self.load_vars()) - self.first_time = None self.poll = False self.announce_name.start() @@ -104,7 +102,7 @@ class SpookyNameRate(Cog): # Define an asyncio.Lock() to make sure the dictionary isn't changed # when checking the messages for duplicate emojis' - async def load_vars(self) -> None: + async def cog_load(self) -> None: """Loads the variables that couldn't be loaded in __init__.""" self.first_time = await self.data.get("first_time", True) self.name = await self.data.get("name") @@ -357,7 +355,6 @@ class SpookyNameRate(Cog): async def get_channel(self) -> Optional[TextChannel]: """Gets the sir-lancebot-channel after waiting until ready.""" - await self.bot.wait_until_ready() channel = self.bot.get_channel( Channels.sir_lancebot_playground ) or await self.bot.fetch_channel(Channels.sir_lancebot_playground) @@ -386,6 +383,6 @@ class SpookyNameRate(Cog): self.announce_name.cancel() -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the SpookyNameRate Cog.""" - bot.add_cog(SpookyNameRate(bot)) + await bot.add_cog(SpookyNameRate(bot)) diff --git a/bot/exts/holidays/halloween/spookyrating.py b/bot/exts/holidays/halloween/spookyrating.py index ec6e8821..373b6583 100644 --- a/bot/exts/holidays/halloween/spookyrating.py +++ b/bot/exts/holidays/halloween/spookyrating.py @@ -62,6 +62,6 @@ class SpookyRating(commands.Cog): await ctx.send(embed=embed) -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Spooky Rating Cog.""" - bot.add_cog(SpookyRating()) + await bot.add_cog(SpookyRating()) diff --git a/bot/exts/holidays/halloween/spookyreact.py b/bot/exts/holidays/halloween/spookyreact.py index e228b91d..945bde33 100644 --- a/bot/exts/holidays/halloween/spookyreact.py +++ b/bot/exts/holidays/halloween/spookyreact.py @@ -17,7 +17,8 @@ SPOOKY_TRIGGERS = { "pumpkin": (r"\bpumpkin\b", "\U0001F383"), "halloween": (r"\bhalloween\b", "\U0001F383"), "jack-o-lantern": (r"\bjack-o-lantern\b", "\U0001F383"), - "danger": (r"\bdanger\b", "\U00002620") + "danger": (r"\bdanger\b", "\U00002620"), + "bat": (r"\bbat((wo)?m[ae]n|persons?|people|s)?\b", "\U0001F987"), } @@ -65,6 +66,6 @@ class SpookyReact(Cog): return False -def setup(bot: Bot) -> None: +async def setup(bot: Bot) -> None: """Load the Spooky Reaction Cog.""" - bot.add_cog(SpookyReact(bot)) + await bot.add_cog(SpookyReact(bot)) |