Fix matching Discord Stable links (oops)

This commit is contained in:
spiral 2021-04-09 10:51:24 +01:00 committed by GitHub
parent 7010becd32
commit a5ad16780c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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));
}
}
}
}