Fix pk;msg with message link
This commit is contained in:
parent
4c1a03bb00
commit
f618bc2403
@ -182,7 +182,7 @@ namespace PluralKit.Bot.Commands {
|
|||||||
ulong messageId;
|
ulong messageId;
|
||||||
if (ulong.TryParse(word, out var id))
|
if (ulong.TryParse(word, out var id))
|
||||||
messageId = 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);
|
messageId = ulong.Parse(match.Groups[1].Value);
|
||||||
else throw new PKSyntaxError($"Could not parse `{word}` as a message ID or link.");
|
else throw new PKSyntaxError($"Could not parse `{word}` as a message ID or link.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user