Skip to content

Commit

Permalink
[Release] Version 3.2.5
Browse files Browse the repository at this point in the history
Changelog:

- Removed channel commerce support (discontinued by Twitch)
- Updated Twitch.Communications package
- Fixed whisper model payload parsing
  • Loading branch information
Syzuna authored Aug 9, 2022
2 parents 6c28cfa + 1c9bc38 commit 3308c21
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 199 deletions.
52 changes: 0 additions & 52 deletions TwitchLib.PubSub/Events/OnChannelCommerceReceivedArgs.cs

This file was deleted.

11 changes: 1 addition & 10 deletions TwitchLib.PubSub/Interfaces/ITwitchPubSub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@ public interface ITwitchPubSub
/// </summary>
event EventHandler<OnClearArgs> OnClear;
/// <summary>
/// Occurs when [on channel commerce].
/// </summary>
event EventHandler<OnChannelCommerceReceivedArgs> OnChannelCommerceReceived;
/// <summary>
/// Occurs when [on emote only].
/// </summary>
event EventHandler<OnEmoteOnlyArgs> OnEmoteOnly;
Expand Down Expand Up @@ -187,11 +183,6 @@ public interface ITwitchPubSub
/// <param name="channelTwitchId">The channel twitch identifier.</param>
void ListenToChatModeratorActions(string myTwitchId, string channelTwitchId);
/// <summary>
/// Listens to commerce events.
/// </summary>
/// <param name="channelTwitchId">The channel twitch identifier.</param>
void ListenToCommerce(string channelTwitchId);
/// <summary>
/// Listens to follows.
/// </summary>
/// <param name="channelId">The channel twitch identifier.</param>
Expand Down Expand Up @@ -243,4 +234,4 @@ public interface ITwitchPubSub
/// <param name="testJsonString">The test json string.</param>
void TestMessageParser(string testJsonString);
}
}
}

This file was deleted.

11 changes: 2 additions & 9 deletions TwitchLib.PubSub/Models/Responses/Messages/Whisper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ public class EmoteObj
/// Emote ID
/// </summary>
/// <value>The identifier.</value>
public int Id { get; protected set; }
public string Id { get; protected set; }
/// <summary>
/// Starting character of emote
/// </summary>
Expand All @@ -275,7 +275,7 @@ public class EmoteObj
/// <param name="json">The json.</param>
public EmoteObj(JToken json)
{
Id = int.Parse(json.SelectToken("id").ToString());
Id = json.SelectToken("emote_id").ToString();
Start = int.Parse(json.SelectToken("start").ToString());
End = int.Parse(json.SelectToken("end").ToString());
}
Expand Down Expand Up @@ -312,11 +312,6 @@ public class RecipientObj
/// </summary>
/// <value>The type of the user.</value>
public string UserType { get; protected set; }
/// <summary>
/// List of badges that the receiver has.
/// </summary>
/// <value>The badges.</value>
public List<Badge> Badges { get; protected set; } = new List<Badge>();

/// <summary>
/// RecipientObj constructor.
Expand All @@ -329,8 +324,6 @@ public RecipientObj(JToken json)
DisplayName = json.SelectToken("display_name")?.ToString();
Color = json.SelectToken("color")?.ToString();
UserType = json.SelectToken("user_type")?.ToString();
foreach (JToken badge in json.SelectToken("badges"))
Badges.Add(new Badge(badge));
}
}

Expand Down
14 changes: 7 additions & 7 deletions TwitchLib.PubSub/TwitchLib.PubSub.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,28 @@
<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
<PackageId>TwitchLib.PubSub</PackageId>
<VersionPrefix>3.2.3</VersionPrefix>
<VersionPrefix>3.2.5</VersionPrefix>
<VersionSuffix>$(VersionSuffix)</VersionSuffix>
<Description>PubSub component of TwitchLib. This component allows you to access Twitch's PubSub event system and subscribe/unsubscribe from topics.</Description>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<Authors>swiftyspiffy,Prom3theu5,Syzuna,LuckyNoS7evin</Authors>
<Company></Company>
<PackageIconUrl>https://colejelinek.com/dev/twitchlib.png</PackageIconUrl>
<PackageIconUrl>https://cdn.syzuna-programs.de/images/twitchlib.png</PackageIconUrl>
<PackageProjectUrl>https://github.com/TwitchLib/TwitchLib.PubSub</PackageProjectUrl>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<Copyright>Copyright 2021</Copyright>
<PackageReleaseNotes>Added new Pubsub Topics like Channel Points and Predictions, many bug fixes</PackageReleaseNotes>
<Copyright>Copyright 2022</Copyright>
<PackageReleaseNotes>Includes a fix for the socket reconnect issues</PackageReleaseNotes>
<RepositoryUrl>https://github.com/TwitchLib/TwitchLib.PubSub</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageTags>twitch library irc chat c# csharp api events pubsub net standard 2.0</PackageTags>
<NeutralLanguage>en-US</NeutralLanguage>
<AssemblyVersion>3.2.3</AssemblyVersion>
<FileVersion>3.2.3</FileVersion>
<AssemblyVersion>3.2.5</AssemblyVersion>
<FileVersion>3.2.5</FileVersion>
<GenerateDocumentationFile>True</GenerateDocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="5.0.0" />
<PackageReference Include="TwitchLib.Communication" Version="1.0.3" />
<PackageReference Include="TwitchLib.Communication" Version="1.0.4" />
</ItemGroup>
</Project>
37 changes: 0 additions & 37 deletions TwitchLib.PubSub/TwitchPubSub.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,6 @@ public class TwitchPubSub : ITwitchPubSub
public event EventHandler<OnBitsReceivedV2Args> OnBitsReceivedV2;
/// <inheritdoc />
/// <summary>
/// Fires when PubSub receives notice of a commerce transaction.
/// </summary>
public event EventHandler<OnChannelCommerceReceivedArgs> OnChannelCommerceReceived;
/// <inheritdoc />
/// <summary>
/// Fires when PubSub receives notice that the stream of the channel being listened to goes online.
/// </summary>
public event EventHandler<OnStreamUpArgs> OnStreamUp;
Expand Down Expand Up @@ -569,26 +564,6 @@ private void ParseMessage(string message)
return;
}
break;
case "channel-commerce-events-v1":
if (msg.MessageData is ChannelCommerceEvents cce)
{
OnChannelCommerceReceived?.Invoke(this, new OnChannelCommerceReceivedArgs
{

Username = cce.Username,
DisplayName = cce.DisplayName,
ChannelName = cce.ChannelName,
UserId = cce.UserId,
ChannelId = cce.ChannelId,
Time = cce.Time,
ItemImageURL = cce.ItemImageURL,
ItemDescription = cce.ItemDescription,
SupportsChannel = cce.SupportsChannel,
PurchaseMessage = cce.PurchaseMessage
});
return;
}
break;
case "channel-ext-v1":
var cEB = msg.MessageData as ChannelExtensionBroadcast;
OnChannelExtensionBroadcast?.Invoke(this, new OnChannelExtensionBroadcastArgs { Messages = cEB.Messages, ChannelId = channelId });
Expand Down Expand Up @@ -879,18 +854,6 @@ public void ListenToBitsEventsV2(string channelTwitchId)
ListenToTopic(topic);
}

/// <inheritdoc />
/// <summary>
/// Sends request to listenOn channel commerce events in specific channel
/// </summary>
/// <param name="channelTwitchId">Channel Id of channel to listen to commerce events on.</param>
public void ListenToCommerce(string channelTwitchId)
{
var topic = $"channel-commerce-events-v1.{channelTwitchId}";
_topicToChannelId[topic] = channelTwitchId;
ListenToTopic(topic);
}

/// <inheritdoc />
/// <summary>
/// Sends request to listenOn video playback events in specific channel
Expand Down

0 comments on commit 3308c21

Please sign in to comment.