Browse Source

Resolve build errors.

pull/1037/head
Alex Gravely 7 years ago
parent
commit
0133e9889b
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs

+ 2
- 2
src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs View File

@@ -24,12 +24,12 @@ namespace Discord.Commands
return executableCommands;
}
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)
{
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 results = await Task.WhenAll(tasks);


Loading…
Cancel
Save