Esempio n. 1
0
        /// <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);
        }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
 /// <summary>
 /// Enroll user in giveaway
 /// </summary>
 /// <param name="viewer">StreamViewer to add to perticipants list</param>
 public void Enroll(StreamViewer viewer)
 {
     Participants.Add(viewer);
 }