Fixed Mention prefix detection
This commit is contained in:
@@ -29,10 +29,16 @@
|
||||
|
||||
int endPos = text.IndexOf('>');
|
||||
if (endPos == -1) return false;
|
||||
if (text.Length < endPos + 2 || text[endPos + 1] != ' ') return false; //Must end in "> "
|
||||
|
||||
ulong userId;
|
||||
if (!MentionUtils.TryParseUser(text.Substring(0, endPos), out userId)) return false;
|
||||
return userId == user.Id;
|
||||
if (!MentionUtils.TryParseUser(text.Substring(0, endPos + 2), out userId)) return false;
|
||||
if (userId == user.Id)
|
||||
{
|
||||
argPos = endPos + 2;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user