Fix pk;msg with message link

This commit is contained in:
Ske 2020-02-07 22:24:03 +01:00
parent 4c1a03bb00
commit f618bc2403

View File

@ -182,7 +182,7 @@ namespace PluralKit.Bot.Commands {
ulong messageId;
if (ulong.TryParse(word, out var id))
messageId = id;
else if (Regex.Match(word, "https://discordapp.com/channels/\\d+/(\\d+)") is Match match && match.Success)
else if (Regex.Match(word, "https://discordapp.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}` as a message ID or link.");