Skip to content

Commit

Permalink
adds MsgParamOriginId to GiftedSubscription model (#267)
Browse files Browse the repository at this point in the history
* GiftedSubscription: add MsgParamOriginId support for tracking messages related to bulk sub gifting
  • Loading branch information
swiftyspiffy authored Sep 6, 2024
1 parent 5677f50 commit 5ef35d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions TwitchLib.Client.Models/GiftedSubscription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ public class GiftedSubscription : UserNoticeBase
/// </summary>
public string MsgParamMonths { get; protected set; } = default!;

/// <summary>
/// If this message sourced from an event, this is the ID of that event
/// </summary>
public string MsgParamOriginId { get; protected set; }

/// <summary>
/// The display name of the subscription gift recipient.
/// </summary>
Expand Down Expand Up @@ -78,6 +83,7 @@ public GiftedSubscription(
Dictionary<string, string>? undocumentedTags,
Goal? msgParamGoal,
string msgParamMonths,
string msgParamOriginId,
string msgParamRecipientDisplayName,
string msgParamRecipientId,
string msgParamRecipientUserName,
Expand All @@ -104,6 +110,7 @@ public GiftedSubscription(
MsgParamGoal = msgParamGoal;
IsAnonymous = userId == AnonymousGifterUserId;
MsgParamMonths = msgParamMonths;
MsgParamOriginId = msgParamOriginId;
MsgParamRecipientDisplayName = msgParamRecipientDisplayName;
MsgParamRecipientId = msgParamRecipientId;
MsgParamRecipientUserName = msgParamRecipientUserName;
Expand All @@ -121,6 +128,9 @@ protected override bool TrySet(KeyValuePair<string, string> tag)
case Tags.MsgParamMonths:
MsgParamMonths = tag.Value;
break;
case Tags.MsgParamOriginId:
MsgParamOriginId = tag.Value;
break;
case Tags.MsgParamRecipientDisplayName:
MsgParamRecipientDisplayName = tag.Value;
break;
Expand Down
1 change: 1 addition & 0 deletions TwitchLib.Client.Models/Internal/Tags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public static class Tags
public const string MsgParamSubPlan = "msg-param-sub-plan"; // Sent only on sub, resub, subgift, anonsubgift
public const string MsgParamSubPlanName = "msg-param-sub-plan-name"; // Sent only on sub, resub, subgift, anonsubgift
public const string MsgParamViewerCount = "msg-param-viewerCount"; // Sent only on raid
public const string MsgParamOriginId = "msg-param-origin-id";
public const string MsgParamRecipientDisplayName = "msg-param-recipient-display-name"; // Sent only on subgift, anonsubgift
public const string MsgParamRecipientId = "msg-param-recipient-id"; // Sent only on subgift, anonsubgift
public const string MsgParamRecipientUsername = "msg-param-recipient-user-name"; // Sent only on subgift, anonsubgift
Expand Down

0 comments on commit 5ef35d5

Please sign in to comment.