From eaa9065d005965df534a735278de749560a56295 Mon Sep 17 00:00:00 2001 From: Googie2149 Date: Wed, 27 Jan 2016 15:49:43 -0500 Subject: [PATCH] Allow ActivationMode.Mention to kinda work in PM from the client --- src/Discord.Net.Commands/CommandService.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Discord.Net.Commands/CommandService.cs b/src/Discord.Net.Commands/CommandService.cs index 2616f65f0..8263d2339 100644 --- a/src/Discord.Net.Commands/CommandService.cs +++ b/src/Discord.Net.Commands/CommandService.cs @@ -98,6 +98,11 @@ namespace Discord.Commands msg = msg.Substring(e.Server.CurrentUser.Mention.Length); 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 @@ -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) return;