Browse Source

Added commands triggering on nickname mentions

pull/73/merge
RogueException 9 years ago
parent
commit
b8cc2eb20f
1 changed files with 13 additions and 0 deletions
  1. +13
    -0
      src/Discord.Net.Commands/CommandService.cs

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

@@ -112,6 +112,19 @@ namespace Discord.Commands
if (msg.StartsWith(mention) && msg.Length > mention.Length)
cmdMsg = msg.Substring(mention.Length + 1);
}

string mention2 = client.CurrentUser.NicknameMention;
if (mention2 != null)
{
if (msg.StartsWith(mention2) && msg.Length > mention2.Length)
cmdMsg = msg.Substring(mention2.Length + 1);
else
{
mention2 = $"@{client.CurrentUser.Name}";
if (msg.StartsWith(mention2) && msg.Length > mention2.Length)
cmdMsg = msg.Substring(mention2.Length + 1);
}
}
}
//Check using custom activator


Loading…
Cancel
Save