Пример #1
0
        public async Task StartAsync(string discordToken)
        {
            var projectAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(a => a.FullName.Contains("BotANick"));
            await _discord.LoginAsync(TokenType.Bot, discordToken);      // Login to discord

            await _discord.StartAsync();                                 // Connect to the websocket

            await _commands.AddModulesAsync(projectAssembly, _provider); // Load commands and modules into the command service

            await BoiteAIdeeService.UpdateBoiteIdees();
        }
Пример #2
0
        public void Start()
        {
            string discordToken = _config["tokens:discord"];     // Get the discord token from the config file

            if (string.IsNullOrWhiteSpace(discordToken))
            {
                throw new ArgumentException("Please enter your bot's token into the `_configuration.json` file found in the applications root directory.");
            }

            TwitchLogs.SetDiscordClient(_discord);
            BoiteAIdeeService.SetDiscordClient(_discord);
            GitHubService.InitConfig(_config);
            _ = StartAsync(discordToken);
        }