diff --git a/PluralKit.Bot/Utils/MentionUtils.cs b/PluralKit.Bot/Utils/MentionUtils.cs index 3ecb3c79..adb8c39e 100644 --- a/PluralKit.Bot/Utils/MentionUtils.cs +++ b/PluralKit.Bot/Utils/MentionUtils.cs @@ -83,13 +83,12 @@ namespace PluralKit.Bot.Utils /// public static bool TryParseChannel(string text, out ulong channelId) { - if (text.Length >= 3 && text[0] == '<' && text[1] == '#' && text[text.Length - 1] == '>') - { + if (text.Length > 3 && text[0] == '<' && text[1] == '#' && text[text.Length - 1] == '>') text = text.Substring(2, text.Length - 3); //<#123> - if (ulong.TryParse(text, NumberStyles.None, CultureInfo.InvariantCulture, out channelId)) - return true; - } + if (ulong.TryParse(text, NumberStyles.None, CultureInfo.InvariantCulture, out channelId)) + return true; + channelId = 0; return false; }