From cffe8546c108b4702b01292642c09f6bbbf63eed Mon Sep 17 00:00:00 2001 From: Corban-Lee Jones Date: Fri, 6 Dec 2024 17:17:30 +0000 Subject: [PATCH] move activity task starter into 'on_ready' event it was being started before the bot websocket was established --- cogs/activity.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cogs/activity.py b/cogs/activity.py index 3f42d50..6ad4127 100644 --- a/cogs/activity.py +++ b/cogs/activity.py @@ -19,7 +19,11 @@ class ActivityCog(commands.Cog): """ def __init__(self, bot: commands.Bot): self.bot = bot - self.update_activity.start() + + @commands.Cog.listener() + async def on_ready(self): + if not self.update_activity.is_running(): + self.update_activity.start() @tasks.loop(seconds=30) async def update_activity(self):