From c740cdc6dc506e1186b9846b72d97d2ddc0636bc Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 28 Feb 2024 13:18:15 -0500 Subject: [PATCH] feat(pterodactyl): fixed some issues and added logging for what user executed a command through the console --- pterodactyl/pterodactyl.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index d0cb4ab..2a2330b 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -52,7 +52,7 @@ class Pterodactyl(commands.Cog): self.logger.error('Failed to retrieve Pterodactyl websocket: %s', e) return - async for websocket in websockets.connect(websocket_credentials['data']['socket'], origin=base_url): + async for websocket in websockets.connect(websocket_credentials['data']['socket'], origin=base_url, ping_timeout=60): try: self.logger.debug("WebSocket connection established") @@ -97,6 +97,7 @@ class Pterodactyl(commands.Cog): @commands.Cog.listener() async def on_message(self, message: discord.Message): if message.channel.id == await self.config.console_channel() and message.author.id != self.bot.user.id: + await message.channel.send(f"Received message from {message.author.id}: {message.content}") await self.websocket.send(json.dumps({"event": "send command", "args": [message.content]})) @commands.group(autohelp = True, name = "pterodactyl", aliases = ["ptero"])