public async Task <bool> StartVote(Func <string, string> eligibilitySelector, List <PollOption> options, Say creator, string topic, CommandPoll poll, int timeout = PollTimeout) { if (ActivePoll != null) { await Respond(creator, $"Please wait, another poll already in progress: {ActivePoll.Topic}"); return(false); } await poll.Setup(eligibilitySelector, options, creator, topic); ActivePoll = poll; pollTimer.Interval = timeout * 1000; pollTimer.Enabled = true; return(true); }
public async Task StartVote(BattleCommand command, Say e, string args) { if (ActivePoll != null) { await Respond(e, "Another poll already in progress, please wait"); return; } var poll = new CommandPoll(this); if (await poll.Setup(command, e, args)) { ActivePoll = poll; pollTimer.Interval = PollTimeout * 1000; pollTimer.Enabled = true; } }