コード例 #1
0
 public CommandHandler(IServiceProvider serviceProvider)
 {
     this.discordClient       = serviceProvider.GetRequiredService <DiscordSocketClient>();
     this.commandService      = serviceProvider.GetRequiredService <CommandService>();
     this.logService          = serviceProvider.GetRequiredService <LogService>();
     this.verificationService = serviceProvider.GetRequiredService <StudentVerificationService>();
     this.config          = serviceProvider.GetRequiredService <IConfiguration>();
     this.serviceProvider = serviceProvider;
     this.discordClient.MessageReceived  += OnMessageReceivedAsync;
     this.commandService.CommandExecuted += HandlePostExecution;
 }
コード例 #2
0
 public VerificationModule(DiscordSocketClient discordClient, CommandService commandService, StudentVerificationService verificationService)
 {
     this.discordClient       = discordClient;
     this.commandService      = commandService;
     this.verificationService = verificationService;
 }