/// <summary>
 /// Creates a new instance of the ChatHostTargetPacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatHostTargetPacketModel(ChatRawPacketModel packet)
     : base(packet)
 {
     this.HostingChannel = packet.Parameters[0];
     this.TargetChannel  = packet.Parameters[1];
     this.ViewerCount    = int.Parse(packet.Parameters[2]);
 }
 /// <summary>
 /// Creates a new instance of the ChatUserStatePacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatUserPacketModelBase(ChatRawPacketModel packet)
     : base(packet)
 {
     this.UserDisplayName = packet.GetTagString("display-name");
     this.UserBadgeInfo   = packet.GetTagString("badge-info");
     this.UserBadges      = packet.GetTagString("badges");
     this.Color           = packet.GetTagString("color");
 }
 /// <summary>
 /// Creates a new instance of the ChatClearChatPacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatClearChatPacketModel(ChatRawPacketModel packet)
     : base(packet)
 {
     if (packet.Parameters.Count > 1)
     {
         this.UserLogin = packet.Parameters.Last();
     }
     this.BanDuration = packet.GetTagLong("ban-duration");
 }
 /// <summary>
 /// Creates a new instance of the ChatRoomStatePacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatRoomStatePacketModel(ChatRawPacketModel packet)
     : base(packet)
 {
     this.EmoteOnly     = packet.GetTagBool("emote-only");
     this.FollowersOnly = packet.GetTagInt("followers-only");
     this.R9K           = packet.GetTagBool("r9k");
     this.Slow          = packet.GetTagInt("slow");
     this.SubsOnly      = packet.GetTagBool("subs-only");
 }
 /// <summary>
 /// Creates a new instance of the ChatHostTargetPacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatHostTargetPacketModel(ChatRawPacketModel packet)
     : base(packet)
 {
     this.HostingChannel = packet.Parameters.Count > 0 ? packet.Parameters[0] : string.Empty;
     this.TargetChannel  = packet.Parameters.Count > 1 ? packet.Parameters[1] : string.Empty;
     if (packet.Parameters.Count > 2 && int.TryParse(packet.Parameters[2], out int viewerCount))
     {
         this.ViewerCount = viewerCount;
     }
 }
Ejemplo n.º 6
0
        /// <summary>
        /// Creates a new instance of the ChatMessagePacketModel class.
        /// </summary>
        /// <param name="packet">The Chat packet</param>
        public ChatMessagePacketModel(ChatRawPacketModel packet)
            : base(packet)
        {
            this.ID      = packet.GetTagString("id");
            this.Message = packet.Get1SkippedParameterText;

            this.UserID          = packet.GetTagString("user-id");
            this.UserLogin       = packet.GetUserLogin;
            this.UserDisplayName = packet.GetTagString("display-name");
            this.UserBadgeInfo   = packet.GetTagString("badge-info");
            this.UserBadges      = packet.GetTagString("badges");
            this.Moderator       = packet.GetTagBool("mod");

            this.Color  = packet.GetTagString("color");
            this.Emotes = packet.GetTagString("emotes");
            this.RoomID = packet.GetTagString("room-id");

            this.Bits = packet.GetTagString("bits");

            this.Timestamp = packet.GetTagString("tmi-sent-ts");
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Creates a new instance of the ChatNoticePacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatNoticePacketModel(ChatRawPacketModel packet)
     : base(packet)
 {
     this.MessageID = packet.GetTagString("msg-id");
     this.Message   = packet.Get1SkippedParameterText;
 }
 /// <summary>
 /// Creates a new instance of the ChatPacketModelBase class.
 /// </summary>
 /// <param name="rawPacket">The raw Chat packet</param>
 public ChatPacketModelBase(ChatRawPacketModel rawPacket)
 {
     this.RawPacket = rawPacket;
 }
 /// <summary>
 /// Creates a new instance of the ChatUserStatePacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatGlobalUserStatePacketModel(ChatRawPacketModel packet)
     : base(packet)
 {
     this.UserID = packet.GetTagLong("user-id");
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Creates a new instance of the ChatUsersListPacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatUsersListPacketModel(ChatRawPacketModel packet)
     : base(packet)
 {
     this.UserLogins = packet.Parameters.Last().Split(new string[] { " " }, StringSplitOptions.RemoveEmptyEntries).ToList();
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Creates a new instance of the ChatWhisperMessagePacketModel
 /// </summary>
 /// <param name="packet"></param>
 public ChatWhisperMessagePacketModel(ChatRawPacketModel packet) : base(packet)
 {
 }
 /// <summary>
 /// Creates a new instance of the ChatUserStatePacketModel class.
 /// </summary>
 /// <param name="packet">The Chat packet</param>
 public ChatUserStatePacketModel(ChatRawPacketModel packet)
     : base(packet)
 {
     this.Moderator = packet.GetTagBool("mod");
     this.EmoteSets = packet.GetTagString("emote-sets");
 }