Esempio n. 1
0
        public async Task Run()
        {
            Console.WriteLine(ZapQuote.RandomQuote());
            _services = ConfigureServices();

            _discord = _services.GetRequiredService <DiscordSocketClient>();

            _commands = new CommandService();

            _discord.Log += LogAsync;

            _discord.UserVoiceStateUpdated += OnVoiceStateUpdated;

            await _discord.LoginAsync(TokenType.Bot, _botToken);

            await _discord.StartAsync();

            await _services.GetRequiredService <CommandHandlingService>().InitializeAsync();

            // Keep the thing running...
            while (true)
            {
                await Task.Delay(TimeSpan.FromMinutes(1));

                // Trigger an update on voice connections
                await BrannigansLaw();
            }
        }
Esempio n. 2
0
 public async Task Zap()
 {
     await ReplyAsync(ZapQuote.RandomQuote());
 }