From 6187e05ee2bf84e9b8cf763a685e3da48ff65306 Mon Sep 17 00:00:00 2001 From: Nihaal Sangha Date: Tue, 30 Aug 2022 05:53:28 +0100 Subject: [PATCH] Fix unescaped period in webhook regex --- discord/webhook/async_.py | 2 +- discord/webhook/sync.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index a01602ec4..855f41a21 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1015,7 +1015,7 @@ class Webhook(BaseWebhook): A partial :class:`Webhook`. A partial webhook is just a webhook object with an ID and a token. """ - m = re.search(r'discord(?:app)?.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,68})', url) + m = re.search(r'discord(?:app)?\.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,68})', url) if m is None: raise ValueError('Invalid webhook URL given') diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index 04c93e437..488639e32 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -682,7 +682,7 @@ class SyncWebhook(BaseWebhook): A partial :class:`Webhook`. A partial webhook is just a webhook object with an ID and a token. """ - m = re.search(r'discord(?:app)?.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,68})', url) + m = re.search(r'discord(?:app)?\.com/api/webhooks/(?P[0-9]{17,20})/(?P[A-Za-z0-9\.\-\_]{60,68})', url) if m is None: raise ValueError('Invalid webhook URL given')