Skip to content

Commit

Permalink
Fix missing service provider in example
Browse files Browse the repository at this point in the history
  • Loading branch information
Still Hsu committed May 27, 2018
1 parent 1a146af commit e9f72b6
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docs/guides/commands/samples/command_handler.cs
Original file line number Diff line number Diff line change
@@ -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<CommandService>();
_client = services.GetRequiredService<DiscordSocketClient>();
}

public async Task InstallCommandsAsync()
Expand Down

0 comments on commit e9f72b6

Please sign in to comment.