Пример #1
0
        private void SetRegular(WinterBot sender, string cmd, string value, bool regular)
        {
            value = value.Trim().ToLower();
            if (!TwitchUsers.IsValidUserName(value))
            {
                sender.WriteDiagnostic(DiagnosticFacility.UserError, "{0}: Invalid username '{1}.", cmd, value);
                return;
            }

            TwitchUser target = sender.Users.GetUser(value);
            if (regular)
            {
                sender.AddRegular(target);
                sender.SendResponse("{0} added to regular list.", value);
            }
            else
            {
                sender.RemoveRegular(target);
                sender.SendResponse("{0} removed from regular list.", value);
            }
        }