public CommandHandlingService(IServiceProvider services) { _services = services; _logger = _services.GetRequiredService <ILogger <CommandHandlingService> >(); _client = _services.GetRequiredService <DiscordSocketClient>(); _configuration = _services.GetRequiredService <IConfiguration>(); _customCommandService = _services.GetRequiredService <CustomCommandService>(); _commandService = _services.GetRequiredService <CommandService>(); _commandPrefix = _configuration.GetValue <string>("prefix"); _commandService.AddModulesAsync(Assembly.GetEntryAssembly(), _services).Wait(); _commandService.CommandExecuted += CommandExecutedAsync; }
public CustomCommandModule(IServiceProvider services) { _services = services; _customCommandService = _services.GetRequiredService <CustomCommandService>(); }