Resolves #390
Fix case insensitive commands forcing parameters to return lowercase
This commit is contained in:
@@ -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();
|
string searchInput = _caseSensitive ? input : input.ToLowerInvariant();
|
||||||
var matches = _map.GetCommands(input).OrderByDescending(x => x.Priority).ToImmutableArray();
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user