fix(pterodactyl): testing a ""solution"" to the websocket closing problem

This commit is contained in:
Seaswimmer 2024-02-28 13:05:04 -05:00
parent ccbce180dd
commit 60f94c4499
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -74,10 +74,10 @@ class Pterodactyl(commands.Cog):
if json.loads(message)['event'] == 'auth success': if json.loads(message)['event'] == 'auth success':
self.logger.debug("Authentication successful") self.logger.debug("Authentication successful")
if json.loads(message)['event'] == 'console output' and await self.config.console_channel() is not None: # if json.loads(message)['event'] == 'console output' and await self.config.console_channel() is not None:
channel = self.bot.get_channel(await self.config.console_channel) # channel = self.bot.get_channel(await self.config.console_channel)
if channel is not None: # if channel is not None:
await channel.send(json.loads(message)['args'][0][:1900]) # await channel.send(json.loads(message)['args'][0][:1900])
#TODO - Add pagification for long messages to prevent Discord API errors #TODO - Add pagification for long messages to prevent Discord API errors
except websockets.exceptions.ConnectionClosed as e: except websockets.exceptions.ConnectionClosed as e:
self.logger.debug("WebSocket connection closed: %s", e) self.logger.debug("WebSocket connection closed: %s", e)