From a5ad16780c2bd9b9a742727b5c3f3a4817b51aa1 Mon Sep 17 00:00:00 2001 From: spiral Date: Fri, 9 Apr 2021 10:51:24 +0100 Subject: [PATCH] Fix matching Discord Stable links (oops) --- PluralKit.Bot/Commands/Misc.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PluralKit.Bot/Commands/Misc.cs b/PluralKit.Bot/Commands/Misc.cs index 70a0c9ab..23b654f3 100644 --- a/PluralKit.Bot/Commands/Misc.cs +++ b/PluralKit.Bot/Commands/Misc.cs @@ -215,7 +215,7 @@ namespace PluralKit.Bot { ulong messageId; if (ulong.TryParse(word, out var id)) messageId = id; - else if (Regex.Match(word, "https://(?:\\w+.)discord(?:app)?.com/channels/\\d+/\\d+/(\\d+)") is Match match && match.Success) + else if (Regex.Match(word, "https://(?:\\w+.)?discord(?:app)?.com/channels/\\d+/\\d+/(\\d+)") is Match match && match.Success) messageId = ulong.Parse(match.Groups[1].Value); else throw new PKSyntaxError($"Could not parse {word.AsCode()} as a message ID or link."); @@ -234,4 +234,4 @@ namespace PluralKit.Bot { await ctx.Reply(embed: await _embeds.CreateMessageInfoEmbed(message)); } } -} \ No newline at end of file +}