From 510f8c788e9a052e8f3e84433aede88db04440cb Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 29 Feb 2024 17:18:03 -0500 Subject: [PATCH] feat(pterodactyl): added sending messages from discord to the server --- pterodactyl/pterodactyl.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index a5e3e91..1cd37fc 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -161,6 +161,8 @@ class Pterodactyl(commands.Cog): 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]})) + if message.channel.id == await self.config.chat_channel() and message.author.id != self.bot.user.id: + await self.websocket.send(json.dumps({"event": "send command", "args": [f"""tellraw @a ["",{"text":"{message.author.display_name} (DISCORD): ","color":"blue"},{"text":"{message.content}","color":"white"}]"""]})) @commands.group(autohelp = True, name = "pterodactyl", aliases = ["ptero"]) async def pterodactyl(self, ctx: commands.Context):