fix(pterodactyl): don't send chat messages to minecraft containing bot commands
Some checks failed
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 19s
Actions / Build Documentation (MkDocs) (pull_request) Successful in 24s

This commit is contained in:
Seaswimmer 2024-02-29 21:51:18 -05:00
parent ef7f574306
commit de5d0194c8
Signed by: cswimr
GPG key ID: B8953EC01E5C4063

View file

@ -182,7 +182,7 @@ class Pterodactyl(commands.Cog):
await self.client._session.close() # pylint: disable=protected-access await self.client._session.close() # pylint: disable=protected-access
@commands.Cog.listener() @commands.Cog.listener()
async def on_message(self, message: discord.Message): async def on_message_without_command(self, message: discord.Message):
if message.channel.id == await self.config.console_channel() and message.author.bot is False: 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]}")