diff options
| author | 2022-11-02 02:07:29 -0700 | |
|---|---|---|
| committer | 2022-11-02 02:07:29 -0700 | |
| commit | 43a2acf5ee4eb354ce3dfaeef9504eee9b9b46b4 (patch) | |
| tree | cbdfeb08f8d582aa98acec6a529f0fa3dcd7933c /bot/exts/holidays/halloween/spookynamerate.py | |
| parent | Appeased the formatter (diff) | |
| parent | Merge pull request #1137 from DivyanshuBist/bug-issue1122-message-of-type-None (diff) | |
Merge branch 'main' into main
Diffstat (limited to 'bot/exts/holidays/halloween/spookynamerate.py')
| -rw-r--r-- | bot/exts/holidays/halloween/spookynamerate.py | 9 |
1 files changed, 3 insertions, 6 deletions
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)) |