Add Pterodactyl cog #19

Merged
cswimr merged 139 commits from pterodactyl into main 2024-03-02 00:07:42 -05:00
Showing only changes of commit 142336e233 - Show all commits

View file

@ -82,6 +82,11 @@ class Pterodactyl(commands.Cog):
if content.startswith('['):
await channel.send(content=content)
#TODO - Add pagification for long messages to prevent Discord API errors
if json.loads(message)['event'] == 'status':
console = self.bot.get_channel(await self.config.console_channel())
if console is not None:
await console.send(f"Server status changed! `{json.loads(message)['args'][0]}`")
except websockets.exceptions.ConnectionClosed as e:
self.logger.debug("WebSocket connection closed: %s", e)
websocket_credentials = client.servers.get_websocket(server_id)