Exemple #1
0
        private async Task MainAsync()
        {
            _client = new DiscordSocketClient(new DiscordSocketConfig {
                AlwaysDownloadUsers = true
            });
            _commands = new CommandService(new CommandServiceConfig {
                DefaultRunMode = RunMode.Async
            });
            _simplyDataAccess = new SimplyDataAccess();
            _tempusDataAccess = new TempusDataAccess();
            _rankUpdater      = new RankUpdater(_client, _simplyDataAccess);
            _statusUpdater    = new StatusUpdater(_client);

            AddClientEvents();

            await Login();

            BuildServiceProvider();

            await InstallCommands();

            await _client.StartAsync();

            _rankUpdateTimer = new Timer(IntervalFunctions, null, 0, FromMinutes(5));

            // Block this task until the program is closed.
            await Task.Delay(-1);
        }
Exemple #2
0
 public RankUpdater(DiscordSocketClient client, SimplyDataAccess simplyDataAccess)
 {
     _client           = client;
     _simplyDataAccess = simplyDataAccess;
 }