From 9023ea160b3b04248b45f64c4a8ff24176099db6 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 29 Feb 2024 17:27:36 -0500 Subject: [PATCH] feat(pterodactyl): added console channel logging for chat messages --- pterodactyl/pterodactyl.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index 03fcfb0..03a8125 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -159,9 +159,12 @@ 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 message.channel.send(f"Received console command from {message.author.id}: {message.content[:1900]}") await self.websocket.send(json.dumps({"event": "send command", "args": [message.content]})) if message.channel.id == await self.config.chat_channel() and message.author.id != self.bot.user.id: + channel = self.bot.get_channel(await self.config.console_channel()) + if channel: + await channel.send(f"Received chat message from {message.author.id}: {message.content[:1900]}") await self.websocket.send(json.dumps({"event": "send command", "args": ['tellraw @a ["",{"text":"%s (DISCORD): ","color":"blue"},{"text":"%s","color":"white"}]', message.author.name, message.content]})) @commands.group(autohelp = True, name = "pterodactyl", aliases = ["ptero"])