fix(pterodactyl): don't try to send messages from bots to the server (for real this time)

This commit is contained in:
Seaswimmer 2024-02-29 21:00:35 -05:00
parent 50dd5c64b4
commit f87f4ee37f
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -174,7 +174,7 @@ class Pterodactyl(commands.Cog):
@commands.Cog.listener() @commands.Cog.listener()
async def on_message(self, message: discord.Message): async def on_message(self, message: discord.Message):
if message.channel.id == await self.config.console_channel() and not message.author.bot: if message.channel.id == await self.config.console_channel() and message.author.bot is False:
self.logger.debug("Received console command from %s: %s", message.author.id, message.content) 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 message.channel.send(f"Received console command from {message.author.id}: {message.content[:1900]}")
try: try:
@ -183,7 +183,7 @@ class Pterodactyl(commands.Cog):
self.logger.error("WebSocket connection closed: %s", e) self.logger.error("WebSocket connection closed: %s", e)
self.task.cancel() self.task.cancel()
self.task = self.get_task() self.task = self.get_task()
if message.channel.id == await self.config.chat_channel() and not message.author.bot: if message.channel.id == await self.config.chat_channel() and message.author.bot is False:
self.logger.debug("Received chat message from %s: %s", message.author.id, message.content) self.logger.debug("Received chat message from %s: %s", message.author.id, message.content)
channel = self.bot.get_channel(await self.config.console_channel()) channel = self.bot.get_channel(await self.config.console_channel())
if channel: if channel: