public async Task Select(MafiaVote vote) { var player = Players.FirstOrDefault(x => x.GetId() == vote.Voter); if (player == null) { return; } var dm = await player.GetDm(); if (_gameStatus != GameStatus.InGame) { await dm.SendMessageAsync("Please wait until a game starts."); return; } if (_selectOptions == null) { await dm.SendMessageAsync("You can't select from anything yet. Please wait."); return; } _selectQueue.Enqueue(vote); }
public async Task VoteFor(MafiaVote vote) { if (_gameStatus != GameStatus.InGame) { await SendGeneral("There isn't a game going on right now."); return; } if (_voteOptions == null) { await SendGeneral("There isn't a vote going on right now."); return; } if (!Players.Exists(x => x.GetId() == vote.Voter)) { await SendGeneral($"<@{vote.Voter}> You aren't a part of this game. Wait until next time."); return; } _voteQueue.Enqueue(vote); }