From bfaa88ce7866828bd2bfca391508c2888b9655a9 Mon Sep 17 00:00:00 2001 From: Alex Gravely Date: Wed, 27 Jun 2018 21:50:42 -0400 Subject: [PATCH] Search through submodules for GetExecutableCommandAsync --- .../Extensions/CommandServiceExtensions.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } }