Skip to content

Commit

Permalink
Merge pull request #245 from AoshiW/PRIVMSG-tags
Browse files Browse the repository at this point in the history
Changelog 2023‑08‑04
  • Loading branch information
Syzuna authored Aug 13, 2023
2 parents 5fea08f + e519ed9 commit d6d26ef
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 11 deletions.
6 changes: 6 additions & 0 deletions TwitchLib.Client.Models/ChatMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,12 @@ public ChatMessage(
ChatReply ??= new ChatReply(); // ChatReply is null if not reply
ChatReply.ParentUserLogin = tagValue;
break;
case Tags.ReplyThreadParentMsgId:
(ChatReply ??= new()).ThreadParentMsgId = tagValue;
break;
case Tags.ReplyThreadParentUserLogin:
(ChatReply ??= new()).ThreadParentUserLogin = tagValue;
break;
case Tags.RoomId:
RoomId = tagValue;
break;
Expand Down
36 changes: 26 additions & 10 deletions TwitchLib.Client.Models/ChatReply.cs
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TwitchLib.Client.Models
namespace TwitchLib.Client.Models
{
/// <summary>Class representing a chat reply/thread</summary>
public class ChatReply
{
/// <summary>Property representing the display name of the responded to message</summary>
/// <summary>
/// The display name of the sender of the direct parent message.
/// </summary>
public string ParentDisplayName { get; internal set; }

/// <summary>Property representing the message contents of the responded to message</summary>
/// <summary>
/// The text of the direct parent message.
/// </summary>
public string ParentMsgBody { get; internal set; }

/// <summary>Property representing the id of the responded to message</summary>
/// <summary>
/// An ID that uniquely identifies the direct parent message that this message is replying to.
/// </summary>
public string ParentMsgId { get; internal set; }

/// <summary>Property representing the user id of the sender of the responded to message</summary>
/// <summary>
/// An ID that identifies the sender of the direct parent message.
/// </summary>
public string ParentUserId { get; internal set; }

/// <summary>Property representing the user login of the sender of the responded to message</summary>
/// <summary>
/// The login name of the sender of the direct parent message.
/// </summary>
public string ParentUserLogin { get; internal set; }

/// <summary>
/// An ID that uniquely identifies the top-level parent message of the reply thread that this message is replying to.
/// </summary>
public string ThreadParentMsgId { get; internal set; }

/// <summary>
/// The login name of the sender of the top-level parent message.
/// </summary>
public string ThreadParentUserLogin { get; internal set; }
}
}
9 changes: 8 additions & 1 deletion TwitchLib.Client.Models/Internal/Tags.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
namespace TwitchLib.Client.Models.Internal
#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member
namespace TwitchLib.Client.Models.Internal
{
public static class Tags
{
Expand Down Expand Up @@ -51,11 +52,17 @@ public static class Tags
public const string PinnedChatPaidExponent = "pinned-chat-paid-exponent";
public const string PinnedChatPaidLevel = "pinned-chat-paid-level";
public const string PinnedChatPaidIsSystemMessage = "pinned-chat-paid-is-system-message";

#region Sent only on replies
public const string ReplyParentDisplayName = "reply-parent-display-name"; // Sent only on replies
public const string ReplyParentMsgBody = "reply-parent-msg-body"; // Sent only on replies
public const string ReplyParentMsgId = "reply-parent-msg-id"; // Sent only on replies
public const string ReplyParentUserId = "reply-parent-user-id"; // Sent only on replies
public const string ReplyParentUserLogin = "reply-parent-user-login"; // Sent only on replies
public const string ReplyThreadParentMsgId = "reply-thread-parent-msg-id";
public const string ReplyThreadParentUserLogin = "reply-thread-parent-user-login";
#endregion

public const string Rituals = "rituals";
public const string RoomId = "room-id";
public const string R9K = "r9k";
Expand Down

0 comments on commit d6d26ef

Please sign in to comment.