aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shivansh-007 <[email protected]>2021-03-06 16:48:23 +0530
committerGravatar Shivansh-007 <[email protected]>2021-10-11 12:05:30 +0530
commit39116e698f48468bec19d03e946c271e0083ccf4 (patch)
tree88a8f10d9dd52b9eabdfe5d3179e5fe8f97ce456
parentAdd a docstring to 'send_webhooks' function (diff)
Update regex to support all message links i.e. support for 'app', 'canary', 'ptb'
-rw-r--r--bot/exts/moderation/incidents.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/exts/moderation/incidents.py b/bot/exts/moderation/incidents.py
index 8304df174..dabdaed2c 100644
--- a/bot/exts/moderation/incidents.py
+++ b/bot/exts/moderation/incidents.py
@@ -26,8 +26,9 @@ CRAWL_LIMIT = 50
CRAWL_SLEEP = 2
DISCORD_MESSAGE_LINK_RE = re.compile(
- r"http(?:s):\/\/discord(?:[\.,]|dot)com(?:\/|slash)channels(?:\/|slash)[0-9]{18}(?:\/|slash)[0-9]{18}"
- r"(?:\/|slash)[0-9]{18}"
+ r'(https?:\/\/(?:(ptb|canary|www)\.)?discord(?:app)?\.com\/channels\/'
+ r'[0-9]{15,21}'
+ r'\/[0-9]{15,21}\/[0-9]{15,21})'
)
@@ -483,7 +484,7 @@ class Incidents(Cog):
embeds = []
for message_link in message_links:
ctx = await self.bot.get_context(message)
- embeds.append(await make_message_link_embed(ctx, message_link))
+ embeds.append(await make_message_link_embed(ctx, message_link[0]))
webhook = await self.bot.fetch_webhook(Webhooks.incidents)
webhook_embed_list = list(grouper(embeds, 10))