fix(pterodactyl): fixed incorrect websocket handling
All checks were successful
Actions / Lint Code (Ruff & Pylint) (push) Successful in 19s
Actions / Build Documentation (MkDocs) (push) Successful in 24s

This commit is contained in:
Seaswimmer 2024-03-02 15:27:34 -05:00
parent 3e18894bb5
commit 8ccb174913
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -63,14 +63,13 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None:
if channel is not 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()) 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)
chat_message = await check_if_chat_message(content) if chat_message:
if chat_message: info = await get_info(chat_message['username'])
info = await get_info(chat_message['username']) if info is not None:
if info is not None: await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], info['data']['player']['avatar'])
await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], info['data']['player']['avatar']) else:
else: await send_chat_discord(coginstance, chat_message['username'], chat_message['message'], 'https://seafsh.cc/u/j3AzqQ.png')
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) join_message = await check_if_join_message(content)
if join_message: if join_message: