From 8ccb17491322b92b3deed0826903b3e18153f4a4 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Sat, 2 Mar 2024 15:27:34 -0500 Subject: [PATCH] fix(pterodactyl): fixed incorrect websocket handling --- pterodactyl/websocket.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pterodactyl/websocket.py b/pterodactyl/websocket.py index dd5a006..97cbd57 100644 --- a/pterodactyl/websocket.py +++ b/pterodactyl/websocket.py @@ -63,14 +63,13 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None: if channel is not None: await channel.send(server_message if len(server_message) < 2000 else server_message[:1997] + '...', allowed_mentions=discord.AllowedMentions.none()) - else: - chat_message = await check_if_chat_message(content) - if chat_message: - info = await get_info(chat_message['username']) - if info is not None: - await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], info['data']['player']['avatar']) - else: - await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], 'https://seafsh.cc/u/j3AzqQ.png') + chat_message = await check_if_chat_message(content) + if chat_message: + info = await get_info(chat_message['username']) + if info is not None: + await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], info['data']['player']['avatar']) + else: + await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], 'https://seafsh.cc/u/j3AzqQ.png') join_message = await check_if_join_message(content) if join_message: