From 87dfc03812a59b1299cdbde991a4bf7639e4205d Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 4 Mar 2024 19:53:12 -0500 Subject: [PATCH] fix(pterodactyl): don't ping users, roles, or @everyone/@here in console messages + ping only users in chat messages --- pterodactyl/websocket.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pterodactyl/websocket.py b/pterodactyl/websocket.py index 5403725..9a17acf 100644 --- a/pterodactyl/websocket.py +++ b/pterodactyl/websocket.py @@ -58,7 +58,7 @@ async def establish_websocket_connection(coginstance: Pterodactyl) -> None: if content.startswith('['): pagified_content = pagify(content, delims=[" ", "\n"]) for page in pagified_content: - await channel.send(content=page) + await channel.send(content=page, allowed_mentions=discord.AllowedMentions.none()) server_message = await check_if_server_message(content) if server_message: @@ -230,7 +230,7 @@ async def send_chat_discord(coginstance: Pterodactyl, username: str, message: st webhook = discord.utils.get(webhooks, name="Pterodactyl Chat") if webhook is None: webhook = await channel.create_webhook(name="Pterodactyl Chat") - await webhook.send(content=message, username=username, avatar_url=avatar_url, allowed_mentions=discord.AllowedMentions.none()) + await webhook.send(content=message, username=username, avatar_url=avatar_url, allowed_mentions=discord.AllowedMentions(everyone=False, roles=False, users=True)) logger.debug("Chat message sent to Discord") else: logger.debug("Chat channel not set. Skipping sending chat message to Discord")