Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
 public async Task InstallCommandsAsync()
 {
     Client.MessageReceived += HandleCommandAsync;
     Client.UserJoined      += UserJoined;
     await Commands.AddModulesAsync(assembly : Assembly.GetEntryAssembly(), services : null);
 }