Browse Source

Search through submodules for GetExecutableCommandAsync

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

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

@@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;


namespace Discord.Commands namespace Discord.Commands
@@ -22,6 +23,6 @@ namespace Discord.Commands
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, context, provider);
public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider) public static Task<IReadOnlyCollection<CommandInfo>> GetExecutableCommandAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider)
=> GetExecutableCommandsAsync(module.Commands, context, provider);
=> GetExecutableCommandsAsync(module.Commands.Concat(module.Submodules.SelectMany(sm => sm.Commands)), context, provider);
} }
} }

Loading…
Cancel
Save