public async Task StartupAsync() { string botToken = _config["Token"]; if (string.IsNullOrWhiteSpace(botToken)) { throw new ArgumentNullException("Token is missing"); } await _client.LoginAsync(Discord.TokenType.Bot, botToken); await _client.StartAsync(); await _commands.AddModulesAsync(Assembly.GetEntryAssembly(), _provider); }
public async Task InstallCommandsAsync() { Client.MessageReceived += HandleCommandAsync; Client.UserJoined += UserJoined; await Commands.AddModulesAsync(assembly : Assembly.GetEntryAssembly(), services : null); }