Browse Source

Allow ActivationMode.Mention to kinda work in PM from the client

tags/docs-0.9
Googie2149 9 years ago
parent
commit
eaa9065d00
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      src/Discord.Net.Commands/CommandService.cs

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

@@ -98,6 +98,11 @@ namespace Discord.Commands
msg = msg.Substring(e.Server.CurrentUser.Mention.Length); msg = msg.Substring(e.Server.CurrentUser.Mention.Length);
activated = true; activated = true;
} }
else if (e.Channel.IsPrivate && msg.StartsWith($"@{client.CurrentUser.Name}"))
{
msg = msg.Substring(client.CurrentUser.Name.Length);
activated = true;
}
} }


// Checking if that's null with the Custom flag set on launch and throwing an // Checking if that's null with the Custom flag set on launch and throwing an
@@ -112,7 +117,8 @@ namespace Discord.Commands
} }
} }


// This kills trying to parse messages when you don't have a command char set or anything else
// This kills trying to parse messages when you don't have a command char set,
// but also keeps it from trying to parse everything when you *do* have something set
if (!activated) if (!activated)
return; return;




Loading…
Cancel
Save