forked from blizzthewolf/SeaCogs
fix(pterodactyl): hopefully fixed the websocket closing on console output event
This commit is contained in:
parent
2017cbb226
commit
ccbce180dd
1 changed files with 3 additions and 2 deletions
|
@ -76,8 +76,9 @@ class Pterodactyl(commands.Cog):
|
||||||
|
|
||||||
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)
|
||||||
await channel.send(json.loads(message)['args'][0][:1900])
|
if channel is not None:
|
||||||
#FIXME - Add pagification for long messages to prevent Discord API errors
|
await channel.send(json.loads(message)['args'][0][:1900])
|
||||||
|
#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)
|
||||||
websocket_credentials = client.servers.get_websocket(server_id)
|
websocket_credentials = client.servers.get_websocket(server_id)
|
||||||
|
|
Loading…
Reference in a new issue