Added support for custom ModuleBase command contexts. Added SocketCommandContext/RpcCommandContext.
This commit is contained in:
@@ -222,9 +222,9 @@ namespace Discord.Commands
|
||||
}
|
||||
|
||||
//Execution
|
||||
public SearchResult Search(CommandContext context, int argPos)
|
||||
public SearchResult Search(ICommandContext context, int argPos)
|
||||
=> Search(context, context.Message.Content.Substring(argPos));
|
||||
public SearchResult Search(CommandContext context, string input)
|
||||
public SearchResult Search(ICommandContext context, string input)
|
||||
{
|
||||
string searchInput = _caseSensitive ? input : input.ToLowerInvariant();
|
||||
var matches = _map.GetCommands(searchInput).OrderByDescending(x => x.Command.Priority).ToImmutableArray();
|
||||
@@ -235,9 +235,9 @@ namespace Discord.Commands
|
||||
return SearchResult.FromError(CommandError.UnknownCommand, "Unknown command.");
|
||||
}
|
||||
|
||||
public Task<IResult> ExecuteAsync(CommandContext context, int argPos, IDependencyMap dependencyMap = null, MultiMatchHandling multiMatchHandling = MultiMatchHandling.Exception)
|
||||
public Task<IResult> ExecuteAsync(ICommandContext context, int argPos, IDependencyMap dependencyMap = null, MultiMatchHandling multiMatchHandling = MultiMatchHandling.Exception)
|
||||
=> ExecuteAsync(context, context.Message.Content.Substring(argPos), dependencyMap, multiMatchHandling);
|
||||
public async Task<IResult> ExecuteAsync(CommandContext context, string input, IDependencyMap dependencyMap = null, MultiMatchHandling multiMatchHandling = MultiMatchHandling.Exception)
|
||||
public async Task<IResult> ExecuteAsync(ICommandContext context, string input, IDependencyMap dependencyMap = null, MultiMatchHandling multiMatchHandling = MultiMatchHandling.Exception)
|
||||
{
|
||||
dependencyMap = dependencyMap ?? DependencyMap.Empty;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user