diff --git a/src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs b/src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs index 014dc14cd..77937fe99 100644 --- a/src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs +++ b/src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; namespace Discord.Commands @@ -22,6 +23,6 @@ namespace Discord.Commands public static Task> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider) => GetExecutableCommandsAsync(commandService.Commands, context, provider); public static Task> 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); } }