-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #28 from djinnet/AddChannelPointsAutomaticRewardRe…
…demptionAddEventClasses Add Channel Points Automatic Reward Redemption Add classes
- Loading branch information
Showing
6 changed files
with
140 additions
and
2 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
TwitchLib.EventSub.Core/Models/ChannelPoints/AutomaticRedemptionReward.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
namespace TwitchLib.EventSub.Core.Models.ChannelPoints; | ||
|
||
/// <summary> | ||
/// Basic information about the reward that was automatically redeemed, at the time it was redeemed. | ||
/// </summary> | ||
public sealed class AutomaticRedemptionReward | ||
{ | ||
/// <summary> | ||
/// The type of reward. One of: | ||
/// ssingle_message_bypass_sub_mode | ||
/// send_highlighted_message | ||
/// random_sub_emote_unlock | ||
/// chosen_sub_emote_unlock | ||
/// chosen_modified_sub_emote_unlock | ||
/// </summary> | ||
public string Type { get; set; } = string.Empty; | ||
/// <summary> | ||
/// The reward cost. | ||
/// </summary> | ||
public int Cost { get; set; } | ||
/// <summary> | ||
/// Optional. Emote that was unlocked. | ||
/// </summary> | ||
public UnlockedEmote? UnlockedEmote { get; set; } | ||
} |
16 changes: 16 additions & 0 deletions
16
TwitchLib.EventSub.Core/Models/ChannelPoints/UnlockedEmote.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace TwitchLib.EventSub.Core.Models.ChannelPoints; | ||
|
||
/// <summary> | ||
/// Represents a unlocked emote | ||
/// </summary> | ||
public sealed class UnlockedEmote | ||
{ | ||
/// <summary> | ||
/// The emote ID. | ||
/// </summary> | ||
public string Id { get; set; } = string.Empty; | ||
/// <summary> | ||
/// The human readable emote token. | ||
/// </summary> | ||
public string Name { get; set; } = string.Empty; | ||
} |
20 changes: 20 additions & 0 deletions
20
TwitchLib.EventSub.Core/Models/Chat/ChatMessageEmoteFragment.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
namespace TwitchLib.EventSub.Core.Models.Chat; | ||
|
||
/// <summary> | ||
/// A Fragment of a emote that holds additional information | ||
/// </summary> | ||
public sealed class ChatMessageEmoteFragment | ||
{ | ||
/// <summary> | ||
/// The emote ID. | ||
/// </summary> | ||
public string Id { get; set; } = string.Empty; | ||
/// <summary> | ||
/// The index of where the Emote starts in the text. | ||
/// </summary> | ||
public int Begin { get; set; } | ||
/// <summary> | ||
/// The index of where the Emote ends in the text. | ||
/// </summary> | ||
public int End { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace TwitchLib.EventSub.Core.Models.Chat; | ||
|
||
/// <summary> | ||
/// Represents a chat message with emotes fragments | ||
/// </summary> | ||
public sealed class ChatMessageEmotes | ||
{ | ||
/// <summary> | ||
/// The text of the chat message. | ||
/// </summary> | ||
public string Text { get; set; } = string.Empty; | ||
/// <summary> | ||
/// An array that includes the emote ID and start and end positions for where the emote appears in the text. | ||
/// </summary> | ||
public ChatMessageEmoteFragment[] Emotes { get; set; } = []; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
TwitchLib.EventSub.Core/SubscriptionTypes/Channel/ChannelPointsAutomaticRewardRedemption.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
using System; | ||
using TwitchLib.EventSub.Core.Models.ChannelPoints; | ||
using TwitchLib.EventSub.Core.Models.Chat; | ||
|
||
namespace TwitchLib.EventSub.Core.SubscriptionTypes.Channel; | ||
|
||
/// <summary> | ||
/// Channel Points Automatic Reward Redemption subscription type model | ||
/// <para>!! The same for all channel points redemption subscription types !!</para> | ||
/// <para>Description:</para> | ||
/// <para>A viewer has redeemed an automatic channel points reward on the specified channel.</para> | ||
/// <para>A redemption of a channel points automatic reward has been updated for the specified channel.</para> | ||
/// </summary> | ||
public sealed class ChannelPointsAutomaticRewardRedemption | ||
{ | ||
/// <summary> | ||
/// The ID of the Redemption. | ||
/// </summary> | ||
public string Id { get; set; } = string.Empty; | ||
/// <summary> | ||
/// The ID of the channel where the reward was redeemed. | ||
/// </summary> | ||
public string BroadcasterUserId { get; set; } = string.Empty; | ||
|
||
/// <summary> | ||
/// The login of the channel where the reward was redeemed. | ||
/// </summary> | ||
public string BroadcasterUserLogin { get; set; } = string.Empty; | ||
/// <summary> | ||
/// The display name of the channel where the reward was redeemed. | ||
/// </summary> | ||
public string BroadcasterUserName { get; set; } = string.Empty; | ||
/// <summary> | ||
/// The ID of the redeeming user. | ||
/// </summary> | ||
public string UserId { get; set; } = string.Empty; | ||
/// <summary> | ||
/// Display name of the user that redeemed the reward. | ||
/// </summary> | ||
public string UserName { get; set; } = string.Empty; | ||
/// <summary> | ||
/// Login of the user that redeemed the reward. | ||
/// </summary> | ||
public string UserLogin { get; set; } = string.Empty; | ||
/// <summary> | ||
/// The user input provided. Empty string if not provided. | ||
/// </summary> | ||
public string UserInput { get; set; } = string.Empty; | ||
/// <summary> | ||
/// An object that contains the user message and emote information needed to recreate the message. | ||
/// </summary> | ||
public ChatMessageEmotes Message { get; set; } = new(); | ||
/// <summary> | ||
/// Basic information about the reward that was redeemed, at the time it was redeemed. | ||
/// </summary> | ||
public AutomaticRedemptionReward Reward { get; set; } = new(); | ||
/// <summary> | ||
/// RFC3339 timestamp of when the reward was redeemed. | ||
/// </summary> | ||
public DateTimeOffset RedeemedAt { get; set; } = DateTimeOffset.MinValue; | ||
} |