Merge pull request #309 from spiralw/patch-2
Fix matching Discord Stable links
This commit is contained in:
commit
3c676d9fef
@ -215,7 +215,7 @@ namespace PluralKit.Bot {
|
|||||||
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://(?:\\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);
|
messageId = ulong.Parse(match.Groups[1].Value);
|
||||||
else throw new PKSyntaxError($"Could not parse {word.AsCode()} as a message ID or link.");
|
else throw new PKSyntaxError($"Could not parse {word.AsCode()} as a message ID or link.");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user