예제 #1
0
파일: Poll.cs 프로젝트: Cruciatum/Haphrain
 internal bool?RemoveReaction(SocketUser usr, string vote)
 {
     if (PollOptions.Where(x => x.Option == vote) == null)
     {
         return(null);
     }
     if (PollReactions.Where(x => x.User.Id == usr.Id) == null)
     {
         return(false);
     }
     PollReactions.Remove(PollReactions.Single(x => x.User.Id == usr.Id && x.PollVote == vote));
     return(true);
 }
예제 #2
0
파일: Poll.cs 프로젝트: Cruciatum/Haphrain
 internal bool?AddReaction(SocketUser usr, string vote)
 {
     if (PollOptions.Where(x => x.Option == vote) == null)
     {
         return(null);
     }
     if (PollReactions.Where(x => x.User.Id == usr.Id) == null)
     {
         return(false);
     }
     PollReactions.Add(new PollReaction(usr, vote));
     return(true);
 }