|
|
@@ -414,7 +414,7 @@ namespace Discord.Commands |
|
|
|
/// <param name="argPos">The position of which the command starts at.</param> |
|
|
|
/// <returns>The result containing the matching commands.</returns> |
|
|
|
public SearchResult Search(ICommandContext context, int argPos) |
|
|
|
=> Search(context, context.Message.Content.Substring(argPos)); |
|
|
|
=> Search(context.Message.Content.Substring(argPos)); |
|
|
|
/// <summary> |
|
|
|
/// Searches for the command. |
|
|
|
/// </summary> |
|
|
@@ -422,6 +422,8 @@ namespace Discord.Commands |
|
|
|
/// <param name="input">The command string.</param> |
|
|
|
/// <returns>The result containing the matching commands.</returns> |
|
|
|
public SearchResult Search(ICommandContext context, string input) |
|
|
|
=> Search(input); |
|
|
|
public SearchResult Search(string input) |
|
|
|
{ |
|
|
|
string searchInput = _caseSensitive ? input : input.ToLowerInvariant(); |
|
|
|
var matches = _map.GetCommands(searchInput).OrderByDescending(x => x.Command.Priority).ToImmutableArray(); |
|
|
@@ -453,7 +455,8 @@ namespace Discord.Commands |
|
|
|
public async Task<IResult> ExecuteAsync(ICommandContext context, string input, IServiceProvider services, MultiMatchHandling multiMatchHandling = MultiMatchHandling.Exception) |
|
|
|
{ |
|
|
|
services = services ?? EmptyServiceProvider.Instance; |
|
|
|
var searchResult = Search(context, input); |
|
|
|
|
|
|
|
var searchResult = Search(input); |
|
|
|
if (!searchResult.IsSuccess) |
|
|
|
return searchResult; |
|
|
|
|
|
|
|