aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-08-20 11:18:02 -0700
committerGravatar MarkKoz <[email protected]>2020-08-20 11:18:02 -0700
commitc0afea19897ec0b47642bb62e4a426f4ca0c3cc8 (patch)
tree945275a3111833c46e4d18126218c8b1f5b60b5f
parentWatchchannels: censor message content if it has a leaked token (diff)
Don't send code block help if message has a webhook token
-rw-r--r--bot/cogs/bot.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py
index 79510739c..93f2eae7c 100644
--- a/bot/cogs/bot.py
+++ b/bot/cogs/bot.py
@@ -9,6 +9,7 @@ from discord.ext.commands import Cog, Context, command, group
from bot.bot import Bot
from bot.cogs.token_remover import TokenRemover
+from bot.cogs.webhook_remover import WEBHOOK_URL_RE
from bot.constants import Categories, Channels, DEBUG_MODE, Guild, MODERATION_ROLES, Roles, URLs
from bot.decorators import with_role
from bot.utils.messages import wait_for_deletion
@@ -240,6 +241,7 @@ class BotCog(Cog, name="Bot"):
and not msg.author.bot
and len(msg.content.splitlines()) > 3
and not TokenRemover.find_token_in_message(msg)
+ and not WEBHOOK_URL_RE.search(msg.content)
)
if parse_codeblock: # no token in the msg