Beispiel #1
0
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            await client.LoginAsync(TokenType.Bot, discordSettings.Token);

            await client.StartAsync();

            while (client.ConnectionState != ConnectionState.Connected)
            {
                _logger.LogInformation("!Connected");
                await Task.Delay(500);
            }

            _ = Task.Run(async() =>
            {
                await SendStartMessage(client);
            });

            // Here we initialize the logic required to register our commands.
            await commandHandlingService.InitializeAsync();

            await Task.Delay(-1);
        }
Beispiel #2
0
        public async Task StartAsync(CancellationToken cancellationToken)
        {
            await _initializationService.InitializeAllAsync();

            _logger.LogInformation("Mit Discord verbinden...");
            await client.LoginAsync(TokenType.Bot, discordSettings.Token);

            await client.StartAsync();

            while (client.ConnectionState != ConnectionState.Connected)
            {
                await Task.Delay(300);
            }

            _logger.LogInformation("Verbunden!");

            _ = Task.Run(async() =>
            {
                await SendBotSpamMessage(client, "Bot wurde gestartet.");
            });

            // Here we initialize the logic required to register our commands.
            await commandHandlingService.InitializeAsync();
        }