Browse Source

Resolves #390

Fix case insensitive commands forcing parameters to return lowercase
tags/1.0-rc
Aux RogueException 8 years ago
parent
commit
d4d8e721db
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      src/Discord.Net.Commands/CommandService.cs

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

@@ -214,9 +214,9 @@ namespace Discord.Commands
public SearchResult Search(CommandContext context, int argPos) => Search(context, context.Message.Content.Substring(argPos)); public SearchResult Search(CommandContext context, int argPos) => Search(context, context.Message.Content.Substring(argPos));
public SearchResult Search(CommandContext context, string input) public SearchResult Search(CommandContext context, string input)
{ {
input = _caseSensitive ? input : input.ToLowerInvariant();
var matches = _map.GetCommands(input).OrderByDescending(x => x.Priority).ToImmutableArray();
string searchInput = _caseSensitive ? input : input.ToLowerInvariant();
var matches = _map.GetCommands(searchInput).OrderByDescending(x => x.Priority).ToImmutableArray();
if (matches.Length > 0) if (matches.Length > 0)
return SearchResult.FromSuccess(input, matches); return SearchResult.FromSuccess(input, matches);
else else


Loading…
Cancel
Save