예제 #1
0
 public ModerationModule(ModerationServices mod,
                         LevelTesting levelTesting,
                         DataServices dataServices,
                         TimerService timer,
                         DownloaderService dlSvc)
 {
     _timer        = timer;
     _dataServices = dataServices;
     _levelTesting = levelTesting;
     _mod          = mod;
     downloaderSvc = dlSvc;
 }
예제 #2
0
        public TimerService(DiscordSocketClient client, ModerationServices mod, LevelTesting levelTesting, Random rand, DataServices dataServices)
        {
            _dataServices = dataServices;
            _client       = client;
            _mod          = mod;
            _levelTesting = levelTesting;
            _random       = rand;

            //Code inside this will fire ever {updateInterval} seconds
            Timer = new Timer(_ =>
            {
                _levelTesting.Announce();
                _levelTesting.CheckServerReservations();
                _mod.Cycle();
                ChangePlaying();
            },
                              null,
                              TimeSpan.FromSeconds(_dataServices.StartDelay),      // Time that message should fire after bot has started
                              TimeSpan.FromSeconds(_dataServices.UpdateInterval)); // Time after which message should repeat (`Timeout.Infinite` for no repeat)
        }
예제 #3
0
 public LevelTestingModule(LevelTesting levelTesting, DataServices dataServices)
 {
     _levelTesting = levelTesting;
     _dataServices = dataServices;
 }