diff options
| author | 2021-08-16 22:08:05 +0200 | |
|---|---|---|
| committer | 2021-08-16 22:08:05 +0200 | |
| commit | 7d732153a218df95d2e7ade8f44d32a13ebe9be6 (patch) | |
| tree | f91adbcafe2f0408930a43285d0c9fae79f869cd | |
| parent | Fix 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.py | 5 |
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 " |