diff options
-rw-r--r-- | bot/exts/info/doc/_cog.py | 3 | ||||
-rw-r--r-- | bot/exts/moderation/modpings.py | 14 | ||||
-rw-r--r-- | bot/exts/moderation/watchchannels/_watchchannel.py | 4 |
3 files changed, 6 insertions, 15 deletions
diff --git a/bot/exts/info/doc/_cog.py b/bot/exts/info/doc/_cog.py index bbdc4e82a..e635c4308 100644 --- a/bot/exts/info/doc/_cog.py +++ b/bot/exts/info/doc/_cog.py @@ -84,8 +84,7 @@ class DocCog(commands.Cog): event_loop=self.bot.loop, ) - @lock(NAMESPACE, COMMAND_LOCK_SINGLETON, raise_error=True) - async def init_refresh_inventory(self) -> None: + async def cog_load(self) -> None: """Refresh documentation inventory on cog initialization.""" await self.bot.wait_until_guild_available() await self.refresh_inventories() diff --git a/bot/exts/moderation/modpings.py b/bot/exts/moderation/modpings.py index 0030ae542..730fc45ee 100644 --- a/bot/exts/moderation/modpings.py +++ b/bot/exts/moderation/modpings.py @@ -3,7 +3,6 @@ import datetime import arrow from async_rediscache import RedisCache -from botcore.utils import scheduling from botcore.utils.scheduling import Scheduler from dateutil.parser import isoparse, parse as dateutil_parse from discord import Embed, Member @@ -41,15 +40,10 @@ class ModPings(Cog): self.guild = None self.moderators_role = None - self.modpings_schedule_task = scheduling.create_task( - self.reschedule_modpings_schedule(), - event_loop=self.bot.loop - ) - self.reschedule_task = scheduling.create_task( - self.reschedule_roles(), - name="mod-pings-reschedule", - event_loop=self.bot.loop, - ) + async def cog_load(self) -> None: + """Schedule both when to reapply role and all mod ping schedules.""" + await self.reschedule_modpings_schedule() + await self.reschedule_roles() async def reschedule_roles(self) -> None: """Reschedule moderators role re-apply times.""" diff --git a/bot/exts/moderation/watchchannels/_watchchannel.py b/bot/exts/moderation/watchchannels/_watchchannel.py index bc78b3934..46f9c296e 100644 --- a/bot/exts/moderation/watchchannels/_watchchannel.py +++ b/bot/exts/moderation/watchchannels/_watchchannel.py @@ -70,8 +70,6 @@ class WatchChannel(metaclass=CogABCMeta): self.message_history = MessageHistory() self.disable_header = disable_header - self._start = scheduling.create_task(self.start_watchchannel(), event_loop=self.bot.loop) - @property def modlog(self) -> ModLog: """Provides access to the ModLog cog for alert purposes.""" @@ -94,7 +92,7 @@ class WatchChannel(metaclass=CogABCMeta): return True - async def start_watchchannel(self) -> None: + async def cog_load(self) -> None: """Starts the watch channel by getting the channel, webhook, and user cache ready.""" await self.bot.wait_until_guild_available() |