From 4174bc4be75ff4d1775b3dfd2926a9a9a60535b2 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 29 Feb 2024 18:53:17 -0500 Subject: [PATCH] fix(pterodactyl): don't accept messages from bots --- pterodactyl/pterodactyl.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pterodactyl/pterodactyl.py b/pterodactyl/pterodactyl.py index e7107aa..40c5a83 100644 --- a/pterodactyl/pterodactyl.py +++ b/pterodactyl/pterodactyl.py @@ -161,11 +161,11 @@ 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: + if message.channel.id == await self.config.console_channel() and not message.author.bot: self.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 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: + if message.channel.id == await self.config.chat_channel() and not message.author.bot: self.logger.debug("Received chat message from %s: %s", message.author.id, message.content) channel = self.bot.get_channel(await self.config.console_channel()) if channel: