Beispiel #1
0
        public async Task DailyTimer(DiscordSocketClient client)
        {
            var startTime = new TimeSpan(24, 0, 0) - DateTime.Now.TimeOfDay;
            var looper    = TimeSpan.FromHours(24);

            _logger.LogInformation($"Daily coins reset timer started - Time to next reset: {startTime.Hours}:{startTime.Minutes}");
            _logger.LogInformation($"Daily coins event appears every 24 hours (00;00)");
            _logger.LogInformation("Clearing old posts started");
            _logger.LogInformation("Birthday timer started");

            //Check if these events happened today
            await _events.BirthdayEvent();

            await _events.CoinReset();

            await _events.ClearOldPosts();

            await _events.EggplantReset();

            dailyTimer = new System.Threading.Timer(async(e) =>
            {
                await _events.BirthdayEvent();
                await _events.CoinReset();
                await _events.ClearOldPosts();
                await _events.EggplantReset();
            }, null, startTime, looper);
        }
Beispiel #2
0
        public async Task ForceDaily()
        {
            await _events.BirthdayEvent();

            await _events.ClearOldPosts();

            await _events.CoinReset();
        }