From 6f4f13e623343e6a702718d0395d4f0fe8c99268 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 1 Mar 2024 13:08:10 -0500 Subject: [PATCH] fix(pterodactyl): adding some debugging code --- pterodactyl/pterodactyl.py | 2 +- pterodactyl/websocket.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index 11a449a..30f5a62 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -44,7 +44,7 @@ class Pterodactyl(commands.Cog): except Exception as e: # pylint: disable=broad-exception-caught logger.error("WebSocket task has failed: %s", e, exc_info=e) self.task.cancel() - self.task = self.get_task() + # self.task = self.get_task() @commands.Cog.listener() async def on_message_without_command(self, message: discord.Message) -> None: diff --git a/pterodactyl/websocket.py b/pterodactyl/websocket.py index 4bf3695..15b3118 100644 --- a/pterodactyl/websocket.py +++ b/pterodactyl/websocket.py @@ -21,6 +21,8 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None: websocket_credentials = await retrieve_websocket_credentials(coginstance) + logger.info("WebSocket connection details retrieved\n%s\n%s", json.dumps(websocket_credentials), base_url) + async with websockets.connect(websocket_credentials['data']['socket'], origin=base_url, ping_timeout=60) as websocket: logger.info("WebSocket connection established")