public VoiceChannelTrackerService(DiscordSocketClient discord, VoiceChannelTrackerSettings settings, ILogger <VoiceChannelTrackerService> logger) : base(discord) { _logger = logger; _discord = discord; _discord.GuildAvailable += InitailizeVoiceChannelTracker; _settings = settings; _clearOldMessagesInterval = TimerHelpers.SetTimeout(async() => { await DeleteOldMessages(); }, 120000, true); }
private async Task StartNewBet(string maxValue) { if (!int.TryParse(maxValue, out var maxRollValue)) { return; } _currentRound = GamblingRound.CreateInstance(maxRollValue); await _gamblingChannel.SendMessageAsync($"New bet (Max roll value: {maxRollValue}) started. Type `!jb` to join this round. Starting in 15 seconds."); _awaitingRollsTimer = TimerHelpers.SetTimeout(async() => { await StartAwaitingRolls(); }, 15000); _rollRemindTimer = TimerHelpers.SetTimeout(async() => { await RemindRollers(); }, 30000); _roundTimeoutTimer = TimerHelpers.SetTimeout(async() => { await EndRound(); }, 45000); }