예제 #1
0
 public async Task VoteToSacrifice(IUser user)
 {
     if (user != null && _game.IsCommandValid("sacrifice", Context.Channel.Id))
     {
         if (!_game.IsUserPlaying(user.Id))
         {
             await ReplyAsync(ErrorView.PlayerNotPlaying(user.Username));
         }
         else if (!_game.IsUserInTeam(user.Id, GroupType.Uninformed))
         {
             await ReplyAsync(ErrorView.InvalidSacrificeTarget(user.Username));
         }
         else if (!_game.IsUserAlive(user.Id))
         {
             await ReplyAsync(ErrorView.RepeatedSacrifice(user.Username));
         }
         else
         {
             await _game.StartSacrificePoll(target : user, author : Context.User);
         }
     }
 }