From 0133e9889b9aee6d324e5c9d4eecfb2d216ed866 Mon Sep 17 00:00:00 2001 From: Alex Gravely Date: Fri, 28 Sep 2018 19:01:04 -0400 Subject: [PATCH] Resolve build errors. --- .../Extensions/CommandServiceExtensions.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs b/src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs index 96ba017c7..0a1c1646c 100644 --- a/src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs +++ b/src/Discord.Net.Commands/Extensions/CommandServiceExtensions.cs @@ -24,12 +24,12 @@ namespace Discord.Commands return executableCommands; } public static Task> GetExecutableCommandsAsync(this CommandService commandService, ICommandContext context, IServiceProvider provider) - => GetExecutableCommandsAsync(commandService.Commands, context, provider); + => GetExecutableCommandsAsync(commandService.Commands.ToArray(), context, provider); public static async Task> GetExecutableCommandsAsync(this ModuleInfo module, ICommandContext context, IServiceProvider provider) { var executableCommands = new List(); - 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);