From 06e011f6709ae4133274b50934833fc4b6ed7cb8 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 8 Apr 2024 06:24:53 -0400 Subject: [PATCH] fix(pterodactyl): don't run update_topic or the websocket tasks before red is ready --- pterodactyl/pterodactyl.py | 1 + pterodactyl/websocket.py | 1 + 2 files changed, 2 insertions(+) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index ae5ea2b..a612e2d 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -74,6 +74,7 @@ class Pterodactyl(commands.Cog): @tasks.loop(minutes=6) async def update_topic(self): + await self.bot.wait_until_red_ready() topic = await self.get_topic() console = self.bot.get_channel(await config.console_channel()) chat = self.bot.get_channel(await config.chat_channel()) diff --git a/pterodactyl/websocket.py b/pterodactyl/websocket.py index bbe11fe..cb09002 100644 --- a/pterodactyl/websocket.py +++ b/pterodactyl/websocket.py @@ -15,6 +15,7 @@ from pterodactyl.pterodactyl import Pterodactyl async def establish_websocket_connection(coginstance: Pterodactyl) -> None: + await coginstance.bot.wait_until_red_ready() base_url = await config.base_url() base_url = base_url[:-1] if base_url.endswith('/') else base_url