| @@ -24,12 +24,12 @@ namespace Discord.Commands | |||||
| return executableCommands; | return executableCommands; | ||||
| } | } | ||||
| public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider) | public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider) | ||||
| => GetExecutableCommandsAsync(commandService.Commands, context, provider); | |||||
| => GetExecutableCommandsAsync(commandService.Commands.ToArray(), context, provider); | |||||
| public static async Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider) | public static async Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandsAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider) | ||||
| { | { | ||||
| var executableCommands = new List<CommandInfo>(); | var executableCommands = new List<CommandInfo>(); | ||||
| executableCommands.AddRange(await module.Commands.GetExecutableCommandsAsync(context, provider).ConfigureAwait(false)); | |||||
| executableCommands.AddRange(await module.Commands.ToArray().GetExecutableCommandsAsync(context, provider).ConfigureAwait(false)); | |||||
| var tasks = module.Submodules.Select(async s => await s.GetExecutableCommandsAsync(context, provider).ConfigureAwait(false)); | var tasks = module.Submodules.Select(async s => await s.GetExecutableCommandsAsync(context, provider).ConfigureAwait(false)); | ||||
| var results = await Task.WhenAll(tasks); | var results = await Task.WhenAll(tasks); | ||||