Browse Source

Removed case sensitivity of commands

tags/docs-0.9
RogueException 9 years ago
parent
commit
36955ac516
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Discord.Net.Commands/CommandMap.cs

+ 3
- 3
src/Discord.Net.Commands/CommandMap.cs View File

@@ -41,7 +41,7 @@ namespace Discord.Commands
{
string nextPart = parts[index];
CommandMap nextGroup;
if (_items.TryGetValue(nextPart, out nextGroup))
if (_items.TryGetValue(nextPart.ToLowerInvariant(), out nextGroup))
return nextGroup.GetItem(index + 1, parts);
else
return null;
@@ -68,7 +68,7 @@ namespace Discord.Commands
{
string nextPart = parts[index];
CommandMap nextGroup;
if (_items.TryGetValue(nextPart, out nextGroup))
if (_items.TryGetValue(nextPart.ToLowerInvariant(), out nextGroup))
{
var cmd = nextGroup.GetCommands(index + 1, parts);
if (cmd != null)
@@ -93,7 +93,7 @@ namespace Discord.Commands
if (index != parts.Length)
{
CommandMap nextGroup;
string name = parts[index];
string name = parts[index].ToLowerInvariant();
string fullName = string.Join(" ", parts, 0, index + 1);
if (!_items.TryGetValue(name, out nextGroup))
{


Loading…
Cancel
Save