From d6bccf20e99ffec813e2ae5e993ac2e5961399b2 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Wed, 13 Mar 2024 01:48:17 -0400 Subject: [PATCH] fix(pterodactyl): fixed a few double pings --- pterodactyl/pterodactyl.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index 67d61b6..a2522a8 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -60,7 +60,7 @@ class Pterodactyl(commands.Cog): async def on_message_without_command(self, message: discord.Message) -> None: if message.channel.id == await config.console_channel() and message.author.bot is False: logger.debug("Received console command from %s: %s", message.author.id, message.content) - await message.channel.send(f"Received console command from {message.author.id}: {message.content[:1900]}") + await message.channel.send(f"Received console command from {message.author.id}: {message.content[:1900]}", allowed_mentions=discord.AllowedMentions.none()) try: await self.websocket.send(json.dumps({"event": "send command", "args": [message.content]})) except websockets.exceptions.ConnectionClosed as e: @@ -72,7 +72,7 @@ class Pterodactyl(commands.Cog): logger.debug("Received chat message from %s: %s", message.author.id, message.content) channel = self.bot.get_channel(await config.console_channel()) if channel: - await channel.send(f"Received chat message from {message.author.id}: {message.content[:1900]}") + await channel.send(f"Received chat message from {message.author.id}: {message.content[:1900]}", allowed_mentions=discord.AllowedMentions.none()) msg = json.dumps({"event": "send command", "args": [await self.get_chat_command(message)]}) logger.debug("Sending chat message to server:\n%s", msg) try: @@ -148,7 +148,7 @@ class Pterodactyl(commands.Cog): channel = self.bot.get_channel(await config.console_channel()) if isinstance(ctx, discord.Interaction): if channel: - await channel.send(f"Received console command from {ctx.user.id}: {command[:1900]}") + await channel.send(f"Received console command from {ctx.user.id}: {command[:1900]}", allowed_mentions=discord.AllowedMentions.none()) try: await self.websocket.send(json.dumps({"event": "send command", "args": [command]})) await ctx.response.send_message(f"Command sent to server. {box(command, 'json')}", ephemeral=True) @@ -160,7 +160,7 @@ class Pterodactyl(commands.Cog): self.task = self.get_task() else: if channel: - await channel.send(f"Received console command from {ctx.author.id}: {command[:1900]}") + await channel.send(f"Received console command from {ctx.author.id}: {command[:1900]}", allowed_mentions=discord.AllowedMentions.none()) try: await self.websocket.send(json.dumps({"event": "send command", "args": [command]})) await ctx.send(f"Command sent to server. {box(command, 'json')}")