public static async void Timer_RemindVote(object sender, ElapsedEventArgs e) { if (ReminderLock) { return; } try { ReminderLock = true; var paramL = ParamDb.GetParam(0, "VoteReminder"); var param = paramL?.FirstOrDefault() ?? new Param { Name = "VoteReminder", Date = System.DateTime.Now }; var dateTo = System.DateTime.Now; dateTo = dateTo.AddHours(-12); var votes = await VoteDb.GetVoters(param.Date, dateTo); param.Date = dateTo; await ParamDb.UpdateParam(param); await SendReminders(votes.Distinct()); } catch { } finally { ReminderLock = false; } }
public static List<string> GetGachaSources() { var par = ParamDb.GetParam(name: "GachaSource"); return par.Select(x => x.Args).ToList(); }