Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds MsgParamOriginId to GiftedSubscription model #267

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading