fix(moderation): handle_expiry task is now actually started
Some checks failed
Pylint / Pylint (push) Failing after 1m13s

This commit is contained in:
Seaswimmer 2023-10-05 13:51:17 -04:00
parent af011e047b
commit a8ea15a5c6
No known key found for this signature in database
GPG key ID: 5019678FD9CF50D8

View file

@ -25,6 +25,7 @@ class Moderation(commands.Cog):
ignore_other_bots = True ignore_other_bots = True
) )
disable_dateutil() disable_dateutil()
self.handle_expiry.start()
async def cog_load(self): async def cog_load(self):
"""This method prepares the database schema for all of the guilds the bot is currently in.""" """This method prepares the database schema for all of the guilds the bot is currently in."""
@ -44,6 +45,9 @@ class Moderation(commands.Cog):
except ConnectionRefusedError: except ConnectionRefusedError:
return return
def cog_unload(self):
self.handle_expiry.cancel()
@commands.Cog.listener('on_guild_join') @commands.Cog.listener('on_guild_join')
async def db_generate_guild_join(self, guild: discord.Guild): async def db_generate_guild_join(self, guild: discord.Guild):
"""This method prepares the database schema whenever the bot joins a guild.""" """This method prepares the database schema whenever the bot joins a guild."""