From e9f72b6ece60ffe142266b01f90bd5ae8b00c742 Mon Sep 17 00:00:00 2001 From: Still Hsu <341464@gmail.com> Date: Sun, 27 May 2018 18:18:52 +0800 Subject: [PATCH] Fix missing service provider in example --- docs/guides/commands/samples/command_handler.cs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/guides/commands/samples/command_handler.cs b/docs/guides/commands/samples/command_handler.cs index 470be2707..d63d550ee 100644 --- a/docs/guides/commands/samples/command_handler.cs +++ b/docs/guides/commands/samples/command_handler.cs @@ -1,12 +1,14 @@ -public class CommandHandle +public class CommandHandler { private readonly DiscordSocketClient _client; private readonly CommandService _commands; + private readonly IServiceProvider _services; - public CommandHandle(DiscordSocketClient client) + public CommandHandler(IServiceProvider services) { - _client = client; - _commands = new CommandService(); + _services = services; + _commands = services.GetRequiredService(); + _client = services.GetRequiredService(); } public async Task InstallCommandsAsync()