mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-05 21:37:55 +00:00
Fix matching canary/ptb Discord links
This commit is contained in:
parent
183f74e0ae
commit
9d17c130c5
1 changed files with 1 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ namespace PluralKit.Bot {
|
|||
ulong messageId;
|
||||
if (ulong.TryParse(word, out var id))
|
||||
messageId = id;
|
||||
else if (Regex.Match(word, "https://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.");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue