Esempio n. 1
0
        public async Task StartAsync(CommandHandler chandler)
        {
            BotConfig config = BotConfig.CheckConfig();

            client = new DiscordSocketClient(new DiscordSocketConfig()
            {
                LogLevel = LogSeverity.Verbose
            });

            Console.Clear();
            client.Log += Util.LoggerAsync;

            await client.LoginAsync(TokenType.Bot, config.Token);

            await client.StartAsync();

            var serviceProvider = ConfigureServices();

            handler = chandler;

            chandler.SetUp(serviceProvider, config.Type);
            await handler.ConfigureAsync();

            await Task.Delay(-1);
        }