aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar D0rs4n <[email protected]>2021-08-16 22:08:05 +0200
committerGravatar D0rs4n <[email protected]>2021-08-16 22:08:05 +0200
commit7d732153a218df95d2e7ade8f44d32a13ebe9be6 (patch)
treef91adbcafe2f0408930a43285d0c9fae79f869cd
parentFix up, and improve code consistency in webhook_remover (diff)
Patch the regEx pattern in webhook_remover to match edge cases
The regEx pattern did not match the 'https://' part in case of canary urls Thus, from now on the regEx pattern matches the full canary urls as well.
-rw-r--r--bot/exts/filters/webhook_remover.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/bot/exts/filters/webhook_remover.py b/bot/exts/filters/webhook_remover.py
index 50bb4bef7..b1592ae07 100644
--- a/bot/exts/filters/webhook_remover.py
+++ b/bot/exts/filters/webhook_remover.py
@@ -9,7 +9,10 @@ from bot.constants import Channels, Colours, Event, Icons
from bot.exts.moderation.modlog import ModLog
from bot.utils.messages import format_user
-WEBHOOK_URL_RE = re.compile(r"((?:https?://)?discord(?:app)?\.com/api/webhooks/\d+/)\S+/?", re.IGNORECASE)
+WEBHOOK_URL_RE = re.compile(
+ r"((?:https?:\/\/)?(?:ptb\.|canary\.)?discord(?:app)?\.com\/api\/webhooks\/\d+\/)\S+\/?",
+ re.IGNORECASE
+)
ALERT_MESSAGE_TEMPLATE = (
"{user}, looks like you posted a Discord webhook URL. Therefore, your "