Skip to content

Commit

Permalink
Merge pull request #25 from TwitchLib/dev
Browse files Browse the repository at this point in the history
[Release] Version 2.5.2
  • Loading branch information
Syzuna authored Apr 11, 2024
2 parents 02fe1da + 7658429 commit 7aa69b7
Show file tree
Hide file tree
Showing 4 changed files with 112 additions and 3 deletions.
7 changes: 7 additions & 0 deletions TwitchLib.EventSub.Core/Models/Chat/ChatCheer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace TwitchLib.EventSub.Core.Models.Chat
{
public sealed class ChatCheer

Check warning on line 3 in TwitchLib.EventSub.Core/Models/Chat/ChatCheer.cs

View workflow job for this annotation

GitHub Actions / release

Missing XML comment for publicly visible type or member 'ChatCheer'
{
public int Bits { get; set; }

Check warning on line 5 in TwitchLib.EventSub.Core/Models/Chat/ChatCheer.cs

View workflow job for this annotation

GitHub Actions / release

Missing XML comment for publicly visible type or member 'ChatCheer.Bits'
}
}
15 changes: 15 additions & 0 deletions TwitchLib.EventSub.Core/Models/Chat/ChatReply.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
namespace TwitchLib.EventSub.Core.Models.Chat
{
public sealed class ChatReply

Check warning on line 3 in TwitchLib.EventSub.Core/Models/Chat/ChatReply.cs

View workflow job for this annotation

GitHub Actions / release

Missing XML comment for publicly visible type or member 'ChatReply'
{
public string ParentMessageId { get; set; } = string.Empty;

Check warning on line 5 in TwitchLib.EventSub.Core/Models/Chat/ChatReply.cs

View workflow job for this annotation

GitHub Actions / release

Missing XML comment for publicly visible type or member 'ChatReply.ParentMessageId'
public string ParentMessageBody { get; set; } = string.Empty;

Check warning on line 6 in TwitchLib.EventSub.Core/Models/Chat/ChatReply.cs

View workflow job for this annotation

GitHub Actions / release

Missing XML comment for publicly visible type or member 'ChatReply.ParentMessageBody'
public string ParentUserId { get; set; } = string.Empty;
public string ParentUserName { get; set; } = string.Empty;
public string ParentUserLogin { get; set; } = string.Empty;
public string ThreadMessageId { get; set; } = string.Empty;
public string ThreadUserId { get; set; } = string.Empty;
public string ThreadUserName { get; set; } = string.Empty;
public string ThreadUserLogin { get; set; } = string.Empty;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using System;
using System.Linq;
using TwitchLib.EventSub.Core.Models.Chat;

namespace TwitchLib.EventSub.Core.SubscriptionTypes.Channel
{
public sealed class ChannelChatMessage
{
/// <summary>
/// The broadcaster user ID.
/// </summary>
public string BroadcasterUserId { get; set; } = string.Empty;
/// <summary>
/// The broadcaster display name.
/// </summary>
public string BroadcasterUserName { get; set; } = string.Empty;
/// <summary>
/// The broadcaster login.
/// </summary>
public string BroadcasterUserLogin { get; set; } = string.Empty;
/// <summary>
/// The user ID of the user that sent the message.
/// </summary>
public string ChatterUserId { get; set; } = string.Empty;
/// <summary>
/// The user name of the user that sent the message.
/// </summary>
public string ChatterUserName { get; set; } = string.Empty;
/// <summary>
/// The user login of the user that sent the message.
/// </summary>
public string ChatterUserLogin { get; set; } = string.Empty;
/// <summary>
/// A UUID that identifies the message.
/// </summary>
public string MessageId { get; set; } = string.Empty;
/// <summary>
/// The structured chat message
/// </summary>
public ChatMessage Message { get; set; } = new();
/// <summary>
/// The color of the user’s name in the chat room.
/// </summary>
public string Color { get; set; } = string.Empty;
/// <summary>
/// Array of chat badges.
/// </summary>
public ChatBadge[] Badges { get; set; } = [];

/// <summary>The type of message. Possible values:</summary>
/// <para>text</para>
/// <para>channel_points_highlighted</para>
/// <para>channel_points_sub_only</para>
/// <para>user_intro</para>
public string MessageType { get; set; } = string.Empty;

/// <summary>
/// Metadata if this message is a cheer.
/// </summary>
public ChatCheer? Cheer { get; set; }

/// <summary>Metadata if this message is a reply.</summary>
public ChatReply? Reply { get; set; }

/// <summary>
/// Optional. The ID of a channel points custom reward that was redeemed.
/// </summary>
public string ChannelPointsCustomRewardId { get; set; } = string.Empty;

/// <summary>
/// Returns true if viewer is a subscriber
/// </summary>
public bool IsSubscriber => Badges.Any(x => x.SetId.Equals("subscriber", StringComparison.OrdinalIgnoreCase));
/// <summary>
/// Returns true if viewer is a moderator
/// </summary>
public bool IsModerator => Badges.Any(x => x.SetId.Equals("moderator", StringComparison.OrdinalIgnoreCase));
/// <summary>
/// Returns true if viewer is a broadcaster
/// </summary>
public bool IsBroadcaster => Badges.Any(x => x.SetId.Equals("broadcaster", StringComparison.OrdinalIgnoreCase));
/// <summary>
/// Returns true if viewer is a vip
/// </summary>
public bool IsVip => Badges.Any(x => x.SetId.Equals("vip", StringComparison.OrdinalIgnoreCase));
}
}
6 changes: 3 additions & 3 deletions TwitchLib.EventSub.Core/TwitchLib.EventSub.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
<PackageId>TwitchLib.EventSub.Core</PackageId>
<Title>TwitchLib.EventSub.Core</Title>
<Authors>swiftyspiffy, Prom3theu5, Syzuna, LuckyNoS7evin</Authors>
<VersionPrefix>2.5.1</VersionPrefix>
<VersionPrefix>2.5.2</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<AssemblyVersion>2.5.1</AssemblyVersion>
<FileVersion>2.5.1</FileVersion>
<AssemblyVersion>2.5.2</AssemblyVersion>
<FileVersion>2.5.2</FileVersion>
<Description>Contains Subscription Types and Models for Twitch's EventSub system</Description>
<PackageIconUrl>https://cdn.syzuna-programs.de/images/twitchlib.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/TwitchLib/TwitchLib.EventSub.Websockets</PackageProjectUrl>
Expand Down

0 comments on commit 7aa69b7

Please sign in to comment.