Fixed crash if prefix mention is checked in PM

This commit is contained in:
RogueException
2016-02-12 00:32:50 -04:00
parent cc788c98a8
commit 196c6ac698

View File

@@ -97,8 +97,8 @@ namespace Discord.Commands
//Check for mention
if (cmdMsg == null && Config.AllowMentionPrefix)
{
if (msg.StartsWith(e.Server.CurrentUser.Mention))
cmdMsg = msg.Substring(e.Server.CurrentUser.Mention.Length + 1);
if (msg.StartsWith(client.CurrentUser.Mention))
cmdMsg = msg.Substring(client.CurrentUser.Mention.Length + 1);
else if (msg.StartsWith($"@{client.CurrentUser.Name}"))
cmdMsg = msg.Substring(client.CurrentUser.Name.Length + 1);
}