Browse Source

Fixed crash if prefix mention is checked in PM

tags/docs-0.9
RogueException 9 years ago
parent
commit
196c6ac698
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net.Commands/CommandService.cs

+ 2
- 2
src/Discord.Net.Commands/CommandService.cs View File

@@ -97,8 +97,8 @@ namespace Discord.Commands
//Check for mention //Check for mention
if (cmdMsg == null && Config.AllowMentionPrefix) 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}")) else if (msg.StartsWith($"@{client.CurrentUser.Name}"))
cmdMsg = msg.Substring(client.CurrentUser.Name.Length + 1); cmdMsg = msg.Substring(client.CurrentUser.Name.Length + 1);
} }


Loading…
Cancel
Save