Beispiel #1
0
        public async Task Run_Bot_Async()
        {
            XMLReader.LoadXML(settings);

            IServiceProvider services = new ServiceCollection()
                                        .AddSingleton(this)
                                        .AddSingleton(client)
                                        .AddSingleton(commands)
                                        .AddSingleton(settings)
                                        .BuildServiceProvider();

            info.Init(settings.GetBotToken(), settings.GetBotPrefix(), client, commands, services);

            discordEvents.Init(info);

            await discordEvents.Register_Commands_Async();

            await info._client.LoginAsync(TokenType.Bot, info._bot_token);

            await info._client.StartAsync();

            await Task.Delay(-1);
        }