/// <summary> /// Check if user is able to enroll in giveaway /// </summary> /// <param name="user"></param> /// <returns></returns> public bool CanEnroll(StreamViewer user) { bool follower = Follower == user.Follower; bool sub = Sub == user.Subscriber; bool mod = Mod == user.Mod; return(follower | sub | mod); }
public bool CanTrigger(StreamViewer user, ChatCommand command) { if (command.ChatMessage.IsBroadcaster) { return(true); } bool viewer = Convert.ToBoolean(ViewerCanTrigger); if (viewer) { return(true); } if (FollowerCanTrigger == true) { if (user.Follower) { return(true); } } if (SubCanTrigger == true) { if (user.Subscriber) { return(true); } } if (ModCanTrigger == true) { if (user.Mod) { return(true); } } return(false); }
/// <summary> /// Enroll user in giveaway /// </summary> /// <param name="viewer">StreamViewer to add to perticipants list</param> public void Enroll(StreamViewer viewer) { Participants.Add(viewer); }