diff --git a/README.md b/README.md index 49a336a..4ac447e 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,18 @@ You can also find a console app example for .NET 8 and for .NET Framework 4.8 in [1]: https://img.shields.io/nuget/v/TwitchLib.EventSub.Websockets.svg?label=TwitchLib.EventSub.Websockets [2]: https://www.nuget.org/packages/TwitchLib.EventSub.Websockets +## Breaking Changes in Version 0.7 +- removed INotificationHandler interface +- Removed deprecated versions of .NET. +- All EventSub events were moved to `TwitchLib.EventSub.Core` Nuget Package, for better management across future EventSub transport Client libraries. + That means their namespace changed from `TwitchLib.EventSub.Websockets.Core.EventArgs.*` to `TwitchLib.EventSub.Core.EventArgs.*`. +- Like Events, all EventSub Models were moved to the `TwitchLib.EventSub.Core` package, (namespace changed from `TwitchLib.EventSub.Websockets.Core.Models` to `TwitchLib.EventSub.Core.Models`) + but to ensure that the models can be used across projects some changes had to be made: + - Properties from `EventSubNotification` were moved to `TwitchLibEventSubEventArgs`. + - Property `Notification` was removed from `TwitchLibEventSubEventArgs`. + - Class `EventSubMetadata` was renamed to `WebsocketEventSubMetadata`. +- `WebsocketDisconnected` and `WebsocketReconnected` now contain more specific EventArgs. + ## Setup Step 1: Create a new project (Console, WPF, ASP.NET) @@ -110,7 +122,7 @@ namespace TwitchLib.EventSub.Websockets.Test } } - private async Task OnWebsocketDisconnected(object sender, EventArgs e) + private async Task OnWebsocketDisconnected(object sender, WebsocketDisconnectedArgs e) { _logger.LogError($"Websocket {_eventSubWebsocketClient.SessionId} disconnected!"); @@ -122,7 +134,7 @@ namespace TwitchLib.EventSub.Websockets.Test } } - private async Task OnWebsocketReconnected(object sender, EventArgs e) + private async Task OnWebsocketReconnected(object sender, WebsocketReconnectedArgs e) { _logger.LogWarning($"Websocket {_eventSubWebsocketClient.SessionId} reconnected"); } diff --git a/TwitchLib.EventSub.Websockets.Example.NetStandard/WebsocketHostedService.cs b/TwitchLib.EventSub.Websockets.Example.NetStandard/WebsocketHostedService.cs index 958eca5..62b2463 100644 --- a/TwitchLib.EventSub.Websockets.Example.NetStandard/WebsocketHostedService.cs +++ b/TwitchLib.EventSub.Websockets.Example.NetStandard/WebsocketHostedService.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; using TwitchLib.Api; using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; +using TwitchLib.EventSub.Core.EventArgs.Channel; namespace TwitchLib.EventSub.Websockets.Example.NetStandard { @@ -50,7 +50,7 @@ private async Task OnErrorOccurred(object sender, ErrorOccuredArgs e) private async Task OnChannelFollow(object sender, ChannelFollowArgs e) { - var eventData = e.Notification.Payload.Event; + var eventData = e.Payload.Event; _logger.LogInformation($"{eventData.UserName} followed {eventData.BroadcasterUserName} at {eventData.FollowedAt}"); } diff --git a/TwitchLib.EventSub.Websockets.Example.NetStandard/WebsocketHostedServiceWithoutDI.cs b/TwitchLib.EventSub.Websockets.Example.NetStandard/WebsocketHostedServiceWithoutDI.cs index 1b4b68d..c90ed0e 100644 --- a/TwitchLib.EventSub.Websockets.Example.NetStandard/WebsocketHostedServiceWithoutDI.cs +++ b/TwitchLib.EventSub.Websockets.Example.NetStandard/WebsocketHostedServiceWithoutDI.cs @@ -5,7 +5,7 @@ using Microsoft.Extensions.Logging; using TwitchLib.Api; using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; +using TwitchLib.EventSub.Core.EventArgs.Channel; namespace TwitchLib.EventSub.Websockets.Example.NetStandard { @@ -46,7 +46,7 @@ private async Task OnErrorOccurred(object sender, ErrorOccuredArgs e) private async Task OnChannelFollow(object sender, ChannelFollowArgs e) { - var eventData = e.Notification.Payload.Event; + var eventData = e.Payload.Event; _logger.LogInformation($"{eventData.UserName} followed {eventData.BroadcasterUserName} at {eventData.FollowedAt}"); } diff --git a/TwitchLib.EventSub.Websockets.Example/WebsocketHostedService.cs b/TwitchLib.EventSub.Websockets.Example/WebsocketHostedService.cs index 7b3e3a4..8f757d8 100644 --- a/TwitchLib.EventSub.Websockets.Example/WebsocketHostedService.cs +++ b/TwitchLib.EventSub.Websockets.Example/WebsocketHostedService.cs @@ -6,8 +6,9 @@ using System.Threading.Tasks; using TwitchLib.Api; using TwitchLib.Api.Core.Enums; +using TwitchLib.EventSub.Core.EventArgs.Channel; using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; +using TwitchLib.EventSub.Websockets.Core.Models; namespace TwitchLib.EventSub.Websockets.Example { @@ -28,8 +29,9 @@ public WebsocketHostedService(ILogger logger, EventSubWe _eventSubWebsocketClient.WebsocketReconnected += OnWebsocketReconnected; _eventSubWebsocketClient.ErrorOccurred += OnErrorOccurred; + _eventSubWebsocketClient.UnknownEventSubNotification += OnUnknownEventSubNotification; _eventSubWebsocketClient.ChannelFollow += OnChannelFollow; - + // Get ClientId and ClientSecret by register an Application here: https://dev.twitch.tv/console/apps // https://dev.twitch.tv/docs/authentication/register-app/ _twitchApi.Settings.ClientId = "YOUR_APP_CLIENT_ID"; @@ -49,7 +51,7 @@ private async Task OnErrorOccurred(object sender, ErrorOccuredArgs e) private async Task OnChannelFollow(object sender, ChannelFollowArgs e) { - var eventData = e.Notification.Payload.Event; + var eventData = e.Payload.Event; _logger.LogInformation($"{eventData.UserName} followed {eventData.BroadcasterUserName} at {eventData.FollowedAt}"); } @@ -81,7 +83,7 @@ await _twitchApi.Helix.EventSub.CreateEventSubSubscriptionAsync("channel.follow" } } - private async Task OnWebsocketDisconnected(object sender, EventArgs e) + private async Task OnWebsocketDisconnected(object sender, WebsocketDisconnectedArgs e) { _logger.LogError($"Websocket {_eventSubWebsocketClient.SessionId} disconnected!"); @@ -93,9 +95,22 @@ private async Task OnWebsocketDisconnected(object sender, EventArgs e) } } - private async Task OnWebsocketReconnected(object sender, EventArgs e) + private async Task OnWebsocketReconnected(object sender, WebsocketReconnectedArgs e) { _logger.LogWarning($"Websocket {_eventSubWebsocketClient.SessionId} reconnected"); } + + // Handling notifications that are not (yet) implemented + private async Task OnUnknownEventSubNotification(object sender, UnknownEventSubNotificationArgs e) + { + var metadata = (WebsocketEventSubMetadata)e.Metadata; + _logger.LogInformation("Received event that has not yet been implemented: type:{type}, version:{version}", metadata.SubscriptionType, metadata.SubscriptionVersion); + + switch((metadata.SubscriptionType, metadata.SubscriptionVersion)) + { + case ("channel.chat.message", "1"): /*code to handle the event*/ break; + default: break; + } + } } } diff --git a/TwitchLib.EventSub.Websockets/Client/WebsocketClient.cs b/TwitchLib.EventSub.Websockets/Client/WebsocketClient.cs index 11bc032..c6a5f30 100644 --- a/TwitchLib.EventSub.Websockets/Client/WebsocketClient.cs +++ b/TwitchLib.EventSub.Websockets/Client/WebsocketClient.cs @@ -154,7 +154,8 @@ private async Task ProcessDataAsync() case WebSocketMessageType.Binary: break; case WebSocketMessageType.Close: - _logger?.LogWebsocketClosed((WebSocketCloseStatus)_webSocket.CloseStatus!, _webSocket.CloseStatusDescription!); + var logLevel = _webSocket.CloseStatus is WebSocketCloseStatus.NormalClosure ? LogLevel.Information : LogLevel.Critical; + _logger?.LogWebsocketClosed(logLevel, (WebSocketCloseStatus)_webSocket.CloseStatus!, _webSocket.CloseStatusDescription!); break; default: throw new ArgumentOutOfRangeException(); diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelAdBreakBeginArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelAdBreakBeginArgs.cs deleted file mode 100644 index 174b567..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelAdBreakBeginArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelAdBreakBeginArgs : TwitchLibEventSubEventArgs> - { - } -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelBanArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelBanArgs.cs deleted file mode 100644 index 4ddaf2b..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelBanArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelBanArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignDonateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignDonateArgs.cs deleted file mode 100644 index 1d8275b..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignDonateArgs.cs +++ /dev/null @@ -1,10 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelCharityCampaignDonateArgs : TwitchLibEventSubEventArgs> - { - - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignProgressArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignProgressArgs.cs deleted file mode 100644 index 07920f7..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignProgressArgs.cs +++ /dev/null @@ -1,10 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelCharityCampaignProgressArgs : TwitchLibEventSubEventArgs> - { - - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignStartArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignStartArgs.cs deleted file mode 100644 index f3b6c21..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignStartArgs.cs +++ /dev/null @@ -1,9 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelCharityCampaignStartArgs : TwitchLibEventSubEventArgs> - { } -} - diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignStopArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignStopArgs.cs deleted file mode 100644 index 9eafd54..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCharityCampaignStopArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelCharityCampaignStopArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatClearArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatClearArgs.cs deleted file mode 100644 index a1b36ba..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatClearArgs.cs +++ /dev/null @@ -1,7 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; - -public class ChannelChatClearArgs : TwitchLibEventSubEventArgs> -{ } diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatClearUserMessagesArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatClearUserMessagesArgs.cs deleted file mode 100644 index e4ff9ef..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatClearUserMessagesArgs.cs +++ /dev/null @@ -1,7 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; - -public class ChannelChatClearUserMessagesArgs : TwitchLibEventSubEventArgs> -{ } diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatMessageArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatMessageArgs.cs deleted file mode 100644 index 8807f4c..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatMessageArgs.cs +++ /dev/null @@ -1,9 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelChatMessageArgs : TwitchLibEventSubEventArgs> - { - } -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatMessageDeleteArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatMessageDeleteArgs.cs deleted file mode 100644 index bf7c5c5..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatMessageDeleteArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelChatMessageDeleteArgs : TwitchLibEventSubEventArgs> - { - } -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatNotificationArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatNotificationArgs.cs deleted file mode 100644 index 43bb582..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelChatNotificationArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelChatNotificationArgs : TwitchLibEventSubEventArgs> - { - } -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCheerArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCheerArgs.cs deleted file mode 100644 index 34291b3..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelCheerArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelCheerArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelFollowArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelFollowArgs.cs deleted file mode 100644 index e6a3c13..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelFollowArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelFollowArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalBeginArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalBeginArgs.cs deleted file mode 100644 index 6a16fd6..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalBeginArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelGoalBeginArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalEndArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalEndArgs.cs deleted file mode 100644 index 5adb38c..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalEndArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelGoalEndArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalProgressArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalProgressArgs.cs deleted file mode 100644 index 057a305..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGoalProgressArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelGoalProgressArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarGuestUpdateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarGuestUpdateArgs.cs deleted file mode 100644 index 04b29c4..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarGuestUpdateArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelGuestStarGuestUpdateArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSessionBeginArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSessionBeginArgs.cs deleted file mode 100644 index dec1519..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSessionBeginArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelGuestStarSessionBeginArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSessionEndArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSessionEndArgs.cs deleted file mode 100644 index aafcba4..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSessionEndArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelGuestStarSessionEndArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSettingsUpdateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSettingsUpdateArgs.cs deleted file mode 100644 index 73231c2..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSettingsUpdateArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelGuestStarSettingsUpdateArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSlotUpdateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSlotUpdateArgs.cs deleted file mode 100644 index 817c604..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelGuestStarSlotUpdateArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelGuestStarSlotUpdateArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainBeginArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainBeginArgs.cs deleted file mode 100644 index 247d388..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainBeginArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelHypeTrainBeginArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainEndArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainEndArgs.cs deleted file mode 100644 index 04718bc..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainEndArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelHypeTrainEndArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainProgressArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainProgressArgs.cs deleted file mode 100644 index 3469c4a..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelHypeTrainProgressArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelHypeTrainProgressArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelModeratorArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelModeratorArgs.cs deleted file mode 100644 index b0d160b..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelModeratorArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelModeratorArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsAutomaticRewardRedemptionArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsAutomaticRewardRedemptionArgs.cs deleted file mode 100644 index d57b9f7..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsAutomaticRewardRedemptionArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; - -public class ChannelPointsAutomaticRewardRedemptionArgs : TwitchLibEventSubEventArgs> -{ -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsCustomRewardArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsCustomRewardArgs.cs deleted file mode 100644 index 8bb13ce..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsCustomRewardArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPointsCustomRewardArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsCustomRewardRedemptionArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsCustomRewardRedemptionArgs.cs deleted file mode 100644 index c1d6049..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPointsCustomRewardRedemptionArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPointsCustomRewardRedemptionArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollBeginArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollBeginArgs.cs deleted file mode 100644 index b665949..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollBeginArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPollBeginArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollEndArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollEndArgs.cs deleted file mode 100644 index 91ed4e9..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollEndArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPollEndArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollProgressArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollProgressArgs.cs deleted file mode 100644 index 2ff67d9..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPollProgressArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPollProgressArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionBeginArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionBeginArgs.cs deleted file mode 100644 index 3d3d2e9..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionBeginArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPredictionBeginArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionEndArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionEndArgs.cs deleted file mode 100644 index 52090d1..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionEndArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPredictionEndArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionLockArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionLockArgs.cs deleted file mode 100644 index f6b2725..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionLockArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPredictionLockArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionProgressArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionProgressArgs.cs deleted file mode 100644 index 3c1839c..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelPredictionProgressArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelPredictionProgressArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelRaidArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelRaidArgs.cs deleted file mode 100644 index b1512b2..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelRaidArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelRaidArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionBeginArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionBeginArgs.cs deleted file mode 100644 index 76a0403..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionBeginArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelSharedChatSessionBeginArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionEndArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionEndArgs.cs deleted file mode 100644 index 82c81fb..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionEndArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelSharedChatSessionEndArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionUpdateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionUpdateArgs.cs deleted file mode 100644 index d996faa..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSharedChatSessionUpdateArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelSharedChatSessionUpdateArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShieldModeBeginArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShieldModeBeginArgs.cs deleted file mode 100644 index a772bf3..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShieldModeBeginArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelShieldModeBeginArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShieldModeEndArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShieldModeEndArgs.cs deleted file mode 100644 index 9df228c..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShieldModeEndArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelShieldModeEndArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShoutoutCreateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShoutoutCreateArgs.cs deleted file mode 100644 index 5985b73..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShoutoutCreateArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelShoutoutCreateArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShoutoutReceiveArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShoutoutReceiveArgs.cs deleted file mode 100644 index 679ae77..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelShoutoutReceiveArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelShoutoutReceiveArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscribeArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscribeArgs.cs deleted file mode 100644 index 60e929f..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscribeArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelSubscribeArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionEndArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionEndArgs.cs deleted file mode 100644 index cacd418..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionEndArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelSubscriptionEndArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionGiftArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionGiftArgs.cs deleted file mode 100644 index aca2331..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionGiftArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelSubscriptionGiftArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionMessageArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionMessageArgs.cs deleted file mode 100644 index f0d894d..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSubscriptionMessageArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelSubscriptionMessageArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSuspiciousUserMessageArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSuspiciousUserMessageArgs.cs deleted file mode 100644 index e0db5b7..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSuspiciousUserMessageArgs.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelSuspiciousUserMessageArgs : TwitchLibEventSubEventArgs> - { - } -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSuspiciousUserUpdateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSuspiciousUserUpdateArgs.cs deleted file mode 100644 index 5b8d851..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelSuspiciousUserUpdateArgs.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public sealed class ChannelSuspiciousUserUpdateArgs : TwitchLibEventSubEventArgs> - { - } -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanArgs.cs deleted file mode 100644 index 154ae03..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelUnbanArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanRequestCreateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanRequestCreateArgs.cs deleted file mode 100644 index 50226f1..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanRequestCreateArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelUnbanRequestCreateArgs : TwitchLibEventSubEventArgs> - { } -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanRequestResolveArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanRequestResolveArgs.cs deleted file mode 100644 index a86c678..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUnbanRequestResolveArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelUnbanRequestResolveArgs : TwitchLibEventSubEventArgs> - { } -} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUpdateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUpdateArgs.cs deleted file mode 100644 index ea1de4a..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelUpdateArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelUpdateArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelVipArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelVipArgs.cs deleted file mode 100644 index 4e7d517..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelVipArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelVipArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelWarningAcknowledgeArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelWarningAcknowledgeArgs.cs deleted file mode 100644 index acfad2e..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelWarningAcknowledgeArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelWarningAcknowledgeArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelWarningSendArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelWarningSendArgs.cs deleted file mode 100644 index e05d67a..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Channel/ChannelWarningSendArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Channel -{ - public class ChannelWarningSendArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/RevocationArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/RevocationArgs.cs index 74c7aa8..cfa4f37 100644 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/RevocationArgs.cs +++ b/TwitchLib.EventSub.Websockets/Core/EventArgs/RevocationArgs.cs @@ -1,7 +1,7 @@ -using TwitchLib.EventSub.Websockets.Core.Models; +using TwitchLib.EventSub.Core.EventArgs; namespace TwitchLib.EventSub.Websockets.Core.EventArgs { - public class RevocationArgs : TwitchLibEventSubEventArgs> + public class RevocationArgs : TwitchLibEventSubNotificationArgs { } } \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Stream/StreamOfflineArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Stream/StreamOfflineArgs.cs deleted file mode 100644 index 67878df..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Stream/StreamOfflineArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Stream; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Stream -{ - public class StreamOfflineArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/Stream/StreamOnlineArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/Stream/StreamOnlineArgs.cs deleted file mode 100644 index c184743..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/Stream/StreamOnlineArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.Stream; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.Stream -{ - public class StreamOnlineArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/TwitchLibEventSubEventArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/TwitchLibEventSubEventArgs.cs deleted file mode 100644 index be57b68..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/TwitchLibEventSubEventArgs.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace TwitchLib.EventSub.Websockets.Core.EventArgs -{ - public abstract class TwitchLibEventSubEventArgs : System.EventArgs where T: new() - { - public T Notification { get; set; } = new T(); - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/UnknownEventSubNotificationArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/UnknownEventSubNotificationArgs.cs new file mode 100644 index 0000000..7916c0e --- /dev/null +++ b/TwitchLib.EventSub.Websockets/Core/EventArgs/UnknownEventSubNotificationArgs.cs @@ -0,0 +1,7 @@ +using System.Text.Json; +using TwitchLib.EventSub.Core.EventArgs; + +namespace TwitchLib.EventSub.Websockets.Core.EventArgs; + +public class UnknownEventSubNotificationArgs : TwitchLibEventSubNotificationArgs +{ } diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/User/UserUpdateArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/User/UserUpdateArgs.cs deleted file mode 100644 index 0cf42b3..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/User/UserUpdateArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.User; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.User -{ - public class UserUpdateArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/User/UserWhisperMessageArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/User/UserWhisperMessageArgs.cs deleted file mode 100644 index 297cdd5..0000000 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/User/UserWhisperMessageArgs.cs +++ /dev/null @@ -1,8 +0,0 @@ -using TwitchLib.EventSub.Core.SubscriptionTypes.User; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Core.EventArgs.User -{ - public class UserWhisperMessageArgs : TwitchLibEventSubEventArgs> - { } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/WebsocketDisconnectedArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/WebsocketDisconnectedArgs.cs index e524180..77a99d7 100644 --- a/TwitchLib.EventSub.Websockets/Core/EventArgs/WebsocketDisconnectedArgs.cs +++ b/TwitchLib.EventSub.Websockets/Core/EventArgs/WebsocketDisconnectedArgs.cs @@ -1,10 +1,5 @@ -using System.Net.WebSockets; +namespace TwitchLib.EventSub.Websockets.Core.EventArgs; -namespace TwitchLib.EventSub.Websockets.Core.EventArgs +public class WebsocketDisconnectedArgs : System.EventArgs { - public class WebsocketDisconnectedArgs : System.EventArgs - { - public WebSocketCloseStatus CloseStatus { get; set; } - public string CloseStatusDescription { get; set; } - } -} \ No newline at end of file +} diff --git a/TwitchLib.EventSub.Websockets/Core/EventArgs/WebsocketReconnectedArgs.cs b/TwitchLib.EventSub.Websockets/Core/EventArgs/WebsocketReconnectedArgs.cs new file mode 100644 index 0000000..a21c9cd --- /dev/null +++ b/TwitchLib.EventSub.Websockets/Core/EventArgs/WebsocketReconnectedArgs.cs @@ -0,0 +1,5 @@ +namespace TwitchLib.EventSub.Websockets.Core.EventArgs; + +public class WebsocketReconnectedArgs : System.EventArgs +{ +} diff --git a/TwitchLib.EventSub.Websockets/Core/Handler/INotificationHandler.cs b/TwitchLib.EventSub.Websockets/Core/Handler/INotificationHandler.cs deleted file mode 100644 index 0e39aa1..0000000 --- a/TwitchLib.EventSub.Websockets/Core/Handler/INotificationHandler.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Text.Json; - -namespace TwitchLib.EventSub.Websockets.Core.Handler -{ - /// - /// Interface describing a NotificationHandler for Twitch EventSub notifications - /// - public interface INotificationHandler - { - /// - /// Type of subscription the handler handles - /// - string SubscriptionType { get; } - - /// - /// Handles incoming notifications that the Handler is designed to handle as described by the SubscriptionType property of the Handler - /// - /// EventSubWebsocketClient that received the notification - /// Message as json string received by the EventSubWebsocketClient - /// Options to configure the JsonSerializer - void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions); - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/Models/EventSubNotification.cs b/TwitchLib.EventSub.Websockets/Core/Models/EventSubNotification.cs deleted file mode 100644 index 5bb0e90..0000000 --- a/TwitchLib.EventSub.Websockets/Core/Models/EventSubNotification.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace TwitchLib.EventSub.Websockets.Core.Models -{ - public class EventSubNotification - { - public EventSubMetadata Metadata { get; set; } - public EventSubNotificationPayload Payload { get; set; } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/Models/EventSubNotificationPayload.cs b/TwitchLib.EventSub.Websockets/Core/Models/EventSubNotificationPayload.cs deleted file mode 100644 index fad563e..0000000 --- a/TwitchLib.EventSub.Websockets/Core/Models/EventSubNotificationPayload.cs +++ /dev/null @@ -1,12 +0,0 @@ -namespace TwitchLib.EventSub.Websockets.Core.Models -{ - public class EventSubNotificationPayload - { - public EventSubTransport Transport { get; set; } - - /// - /// The event’s data. - /// - public T Event { get; set; } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/Models/EventSubTransport.cs b/TwitchLib.EventSub.Websockets/Core/Models/EventSubTransport.cs deleted file mode 100644 index 78c0312..0000000 --- a/TwitchLib.EventSub.Websockets/Core/Models/EventSubTransport.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace TwitchLib.EventSub.Websockets.Core.Models -{ - public class EventSubTransport - { - public string Method { get; set; } - public string WebsocketId { get; set; } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/Models/EventSubWebsocketSessionInfoMessage.cs b/TwitchLib.EventSub.Websockets/Core/Models/EventSubWebsocketSessionInfoMessage.cs deleted file mode 100644 index acf4a72..0000000 --- a/TwitchLib.EventSub.Websockets/Core/Models/EventSubWebsocketSessionInfoMessage.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace TwitchLib.EventSub.Websockets.Core.Models -{ - public class EventSubWebsocketSessionInfoMessage - { - public EventSubMetadata Metadata { get; set; } - public EventSubWebsocketSessionInfoPayload Payload { get; set; } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Core/Models/EventSubMetadata.cs b/TwitchLib.EventSub.Websockets/Core/Models/WebsocketEventSubMetadata.cs similarity index 66% rename from TwitchLib.EventSub.Websockets/Core/Models/EventSubMetadata.cs rename to TwitchLib.EventSub.Websockets/Core/Models/WebsocketEventSubMetadata.cs index 1c0c63b..3c6adfb 100644 --- a/TwitchLib.EventSub.Websockets/Core/Models/EventSubMetadata.cs +++ b/TwitchLib.EventSub.Websockets/Core/Models/WebsocketEventSubMetadata.cs @@ -1,8 +1,10 @@ using System; +using System.Diagnostics.CodeAnalysis; +using TwitchLib.EventSub.Core.Models; namespace TwitchLib.EventSub.Websockets.Core.Models; -public class EventSubMetadata +public class WebsocketEventSubMetadata : EventSubMetadata { /// /// An ID that uniquely identifies message. @@ -28,4 +30,9 @@ public class EventSubMetadata /// The subscription version. /// public string? SubscriptionVersion { get; set; } -} \ No newline at end of file + +#if NET8_0_OR_GREATER + [MemberNotNullWhen(true, nameof(SubscriptionType), nameof(SubscriptionVersion))] +#endif + public bool HasSubscriptionInfo => SubscriptionType is not null && SubscriptionVersion is not null; +} diff --git a/TwitchLib.EventSub.Websockets/EventSubWebsocketClient.cs b/TwitchLib.EventSub.Websockets/EventSubWebsocketClient.cs index 7c54122..f216a6f 100644 --- a/TwitchLib.EventSub.Websockets/EventSubWebsocketClient.cs +++ b/TwitchLib.EventSub.Websockets/EventSubWebsocketClient.cs @@ -2,22 +2,25 @@ using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging.Abstractions; using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using System.Text; using System.Text.Json; using System.Threading; using System.Threading.Tasks; using TwitchLib.EventSub.Core; +using TwitchLib.EventSub.Core.EventArgs; +using TwitchLib.EventSub.Core.EventArgs.Automod; +using TwitchLib.EventSub.Core.EventArgs.Channel; +using TwitchLib.EventSub.Core.EventArgs.Conduit; +using TwitchLib.EventSub.Core.EventArgs.Stream; +using TwitchLib.EventSub.Core.EventArgs.User; using TwitchLib.EventSub.Core.Extensions; +using TwitchLib.EventSub.Core.Models; +using TwitchLib.EventSub.Core.SubscriptionTypes.Automod; using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; +using TwitchLib.EventSub.Core.SubscriptionTypes.Conduit; +using TwitchLib.EventSub.Core.SubscriptionTypes.Stream; +using TwitchLib.EventSub.Core.SubscriptionTypes.User; using TwitchLib.EventSub.Websockets.Client; using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Stream; -using TwitchLib.EventSub.Websockets.Core.EventArgs.User; -using TwitchLib.EventSub.Websockets.Core.Handler; using TwitchLib.EventSub.Websockets.Core.Models; using TwitchLib.EventSub.Websockets.Extensions; @@ -37,7 +40,7 @@ public class EventSubWebsocketClient /// /// Event that triggers when the websocket disconnected /// - public event AsyncEventHandler? WebsocketDisconnected; + public event AsyncEventHandler? WebsocketDisconnected; /// /// Event that triggers when an error occurred on the websocket /// @@ -45,7 +48,44 @@ public class EventSubWebsocketClient /// /// Event that triggers when the websocket was successfully reconnected /// - public event AsyncEventHandler? WebsocketReconnected; + public event AsyncEventHandler? WebsocketReconnected; + /// + /// Event that triggers when the websocket received revocation event + /// + public event AsyncEventHandler? Revocation; + + /// + /// Event that triggers when EventSub send notification, that's unknown. (ie.: not implementet ... yet!) + /// + public event AsyncEventHandler? UnknownEventSubNotification; + /// + /// Event that triggers on "automod.message.hold" notifications + /// + public event AsyncEventHandler? AutomodMessageHold; + /// + /// Event that triggers on "automod.message.hold" notifications + /// + public event AsyncEventHandler? AutomodMessageHoldV2; + /// + /// Event that triggers on "automod.message.update" notifications + /// + public event AsyncEventHandler? AutomodMessageUpdate; + /// + /// Event that triggers on "automod.message.update" notifications + /// + public event AsyncEventHandler? AutomodMessageUpdateV2; + /// + /// Event that triggers on "automod.settings.update" notifications + /// + public event AsyncEventHandler? AutomodSettingsUpdate; + /// + /// Event that triggers on "automod.terms.update" notifications + /// + public event AsyncEventHandler? AutomodTermsUpdate; + /// + /// Event that triggers on "channel.bits.use" notifications + /// + public event AsyncEventHandler? ChannelBitsUse; /// /// Event that triggers on "channel.ad_break.begin" notifications @@ -95,6 +135,18 @@ public class EventSubWebsocketClient /// public event AsyncEventHandler? ChannelChatNotification; /// + /// Event that triggers on "channel.chat_settings.update" notifications + /// + public event AsyncEventHandler? ChannelChatSettingsUpdate; + /// + /// Event that triggers on "channel.chat.user_message_hold" notifications + /// + public event AsyncEventHandler? ChannelChatUserMessageHold; + /// + /// Event that triggers on "channel.chat.user_message_update" notifications + /// + public event AsyncEventHandler? ChannelChatUserMessageUpdate; + /// /// Event that triggers on "channel.cheer" notifications /// public event AsyncEventHandler? ChannelCheer; @@ -103,6 +155,11 @@ public class EventSubWebsocketClient /// public event AsyncEventHandler? ChannelFollow; + /// + /// Event that triggers on "conduit.shard.disabled" notifications + /// + public event AsyncEventHandler? ConduitShardDisabled; + /// /// Event that triggers on "channel.goal.begin" notifications /// @@ -123,33 +180,36 @@ public class EventSubWebsocketClient /// /// Event that triggers on "channel.guest_star_session.begin" notifications /// - public event AsyncEventHandler? ChannelGuestStarSessionBegin; + public event AsyncEventHandler? ChannelGuestStarSessionBegin; /// /// Event that triggers on "channel.guest_star_guest.update" notifications /// - public event AsyncEventHandler? ChannelGuestStarSessionEnd; + public event AsyncEventHandler? ChannelGuestStarSessionEnd; /// /// Event that triggers on "channel.guest_star_settings.update" notifications /// public event AsyncEventHandler? ChannelGuestStarSettingsUpdate; - /// - /// Event that triggers on "channel.guest_star_slot.update" notifications - /// - public event AsyncEventHandler? ChannelGuestStarSlotUpdate; - /// /// Event that triggers on "channel.hype_train.begin" notifications /// - public event AsyncEventHandler? ChannelHypeTrainBegin; + public event AsyncEventHandler? ChannelHypeTrainBeginV2; /// /// Event that triggers on "channel.hype_train.end" notifications /// - public event AsyncEventHandler? ChannelHypeTrainEnd; + public event AsyncEventHandler? ChannelHypeTrainEndV2; /// /// Event that triggers on "channel.hype_train.progress" notifications /// - public event AsyncEventHandler? ChannelHypeTrainProgress; + public event AsyncEventHandler? ChannelHypeTrainProgressV2; + /// + /// Event that triggers on "channel.moderate" notifications + /// + public event AsyncEventHandler? ChannelModerate; + /// + /// Event that triggers on "channel.moderate" notifications + /// + public event AsyncEventHandler? ChannelModerateV2; /// /// Event that triggers on "channel.moderator.add" notifications /// @@ -185,6 +245,10 @@ public class EventSubWebsocketClient /// Event that triggers on "channel.channel_points_automatic_reward_redemption.add" notifications /// public event AsyncEventHandler? ChannelPointsAutomaticRewardRedemptionAdd; + /// + /// Event that triggers on "channel.channel_points_automatic_reward_redemption.add" notifications + /// + public event AsyncEventHandler? ChannelPointsAutomaticRewardRedemptionAddV2; /// /// Event that triggers on "channel.channel_points_custom_reward_redemption.add" notifications @@ -313,17 +377,17 @@ public class EventSubWebsocketClient /// Event that triggers on "user.whisper.message" notifications /// public event AsyncEventHandler? UserWhisperMessage; - + /// /// Event that triggers on "channel.shared_chat.begin" notifications /// public event AsyncEventHandler? ChannelSharedChatSessionBegin; - + /// /// Event that triggers on "channel.shared_chat.update" notifications /// public event AsyncEventHandler? ChannelSharedChatSessionUpdate; - + /// /// Event that triggers on "channel.shared_chat.end" notifications /// @@ -356,9 +420,8 @@ public class EventSubWebsocketClient private WebsocketClient _websocketClient; - private readonly Dictionary> _handlers = new(); private readonly ILogger _logger; - private readonly ILoggerFactory? _loggerFactory; + private readonly ILoggerFactory _loggerFactory; private readonly IServiceProvider? _serviceProvider; private readonly JsonSerializerOptions _jsonSerializerOptions = new JsonSerializerOptions @@ -374,11 +437,10 @@ public class EventSubWebsocketClient /// Instantiates an EventSubWebsocketClient used to subscribe to EventSub notifications via Websockets. /// /// Logger for the EventSubWebsocketClient - /// Enumerable of SubscriptionType handlers /// DI Container to resolve other dependencies dynamically /// Underlying Websocket client to connect to connect to EventSub Websocket service /// Throws ArgumentNullException if a dependency is null - public EventSubWebsocketClient(ILogger logger, IEnumerable handlers, IServiceProvider serviceProvider, WebsocketClient websocketClient) + public EventSubWebsocketClient(ILogger logger, IServiceProvider serviceProvider, WebsocketClient websocketClient) { _logger = logger ?? throw new ArgumentNullException(nameof(logger)); _serviceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider)); @@ -387,8 +449,6 @@ public EventSubWebsocketClient(ILogger logger, IEnumera _websocketClient.OnDataReceived += OnDataReceived; _websocketClient.OnErrorOccurred += OnErrorOccurred; - PrepareHandlers(handlers); - _reconnectComplete = false; _reconnectRequested = false; } @@ -399,27 +459,14 @@ public EventSubWebsocketClient(ILogger logger, IEnumera /// LoggerFactory used to construct Loggers for the EventSubWebsocketClient and underlying classes public EventSubWebsocketClient(ILoggerFactory? loggerFactory = null) { - _loggerFactory = loggerFactory; + _loggerFactory = loggerFactory ?? NullLoggerFactory.Instance; - _logger = _loggerFactory != null - ? _loggerFactory.CreateLogger() - : NullLogger.Instance; - - _websocketClient = _loggerFactory != null - ? new WebsocketClient(_loggerFactory.CreateLogger()) - : new WebsocketClient(); + _logger = _loggerFactory.CreateLogger(); + _websocketClient = new WebsocketClient(_loggerFactory.CreateLogger()); _websocketClient.OnDataReceived += OnDataReceived; _websocketClient.OnErrorOccurred += OnErrorOccurred; - var handlers = typeof(INotificationHandler) - .Assembly.ExportedTypes - .Where(x => typeof(INotificationHandler).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract) - .Select(Activator.CreateInstance).Cast() - .ToList(); - - PrepareHandlers(handlers); - _reconnectComplete = false; _reconnectRequested = false; } @@ -481,7 +528,7 @@ private async Task ReconnectAsync(Uri url) var reconnectClient = _serviceProvider != null ? _serviceProvider.GetRequiredService() - : new WebsocketClient(_loggerFactory?.CreateLogger()); + : new WebsocketClient(_loggerFactory.CreateLogger()); reconnectClient.OnDataReceived += OnDataReceived; reconnectClient.OnErrorOccurred += OnErrorOccurred; @@ -504,7 +551,7 @@ private async Task ReconnectAsync(Uri url) await oldRunningClient.DisconnectAsync(); oldRunningClient.Dispose(); - await WebsocketReconnected.InvokeAsync(this, EventArgs.Empty); + await WebsocketReconnected.InvokeAsync(this, new()); _reconnectRequested = false; _reconnectComplete = false; @@ -527,7 +574,7 @@ private async Task ReconnectAsync(Uri url) _websocketClient = _serviceProvider != null ? _serviceProvider.GetRequiredService() - : new WebsocketClient(_loggerFactory?.CreateLogger()); + : new WebsocketClient(_loggerFactory.CreateLogger()); _websocketClient.OnDataReceived += OnDataReceived; _websocketClient.OnErrorOccurred += OnErrorOccurred; @@ -535,28 +582,11 @@ private async Task ReconnectAsync(Uri url) if (!await ConnectAsync()) return false; - await WebsocketReconnected.InvokeAsync(this, EventArgs.Empty); + await WebsocketReconnected.InvokeAsync(this, new()); return true; } - /// - /// Setup handlers for all supported subscription types - /// - /// Enumerable of handlers that are responsible for acting on a specified subscription type - private void PrepareHandlers(IEnumerable handlers) - { - foreach (var handler in handlers) - { -#if NET6_0_OR_GREATER - _handlers.TryAdd(handler.SubscriptionType, handler.Handle); -#else - if (!_handlers.ContainsKey(handler.SubscriptionType)) - _handlers.Add(handler.SubscriptionType, handler.Handle); -#endif - } - } - /// /// Background operation checking the client health based on the last received message and the Twitch specified minimum frequency + a 20% grace period. /// E.g. a Twitch specified 10 seconds minimum frequency would result in 12 seconds used by the client to honor network latencies and so on. @@ -576,7 +606,7 @@ private async Task ConnectionCheckAsync() await DisconnectAsync(); - await WebsocketDisconnected.InvokeAsync(this, EventArgs.Empty); + await WebsocketDisconnected.InvokeAsync(this, new()); } /// @@ -584,45 +614,45 @@ private async Task ConnectionCheckAsync() /// /// Sender of the event. In this case /// EventArgs send with the event. - private async Task OnDataReceived(object sender, DataReceivedArgs e) + private async Task OnDataReceived(object? sender, DataReceivedArgs e) { _logger?.LogMessage(e.Bytes); _lastReceived = DateTimeOffset.Now; var json = JsonDocument.Parse(e.Bytes); - var metadata = json.RootElement.GetProperty("metadata"u8); - var messageType = metadata.GetProperty("message_type"u8).GetString(); - switch (messageType) + var metadata = json.RootElement.GetProperty("metadata"u8).Deserialize(_jsonSerializerOptions)!; + var payload = json.RootElement.GetProperty("payload"u8); + + try { - case "session_welcome": - await HandleWelcome(e.Bytes); - break; - case "session_disconnect": - await HandleDisconnect(e.Bytes); - break; - case "session_reconnect": - HandleReconnect(e.Bytes); - break; - case "session_keepalive": - HandleKeepAlive(e.Bytes); - break; - case "notification": - var subscriptionType = metadata.GetProperty("subscription_type"u8).GetString(); - if (string.IsNullOrWhiteSpace(subscriptionType)) - { - await ErrorOccurred.InvokeAsync(this, new ErrorOccuredArgs { Exception = new ArgumentNullException(nameof(subscriptionType)), Message = "Unable to determine subscription type!" }); + switch (metadata.MessageType) + { + case "session_welcome": + await HandleWelcome(metadata, payload); break; - } - var message1 = Encoding.UTF8.GetString(e.Bytes); - HandleNotification(message1, subscriptionType!); - break; - case "revocation": - var message2 = Encoding.UTF8.GetString(e.Bytes); - HandleRevocation(message2); - break; - default: - _logger?.LogUnknownMessageType(messageType); - break; + case "session_disconnect": + await HandleDisconnect(metadata, payload); + break; + case "session_reconnect": + HandleReconnect(metadata, payload); + break; + case "session_keepalive": + HandleKeepAlive(metadata, payload); + break; + case "notification": + await HandleNotificationAsync(metadata, payload); + break; + case "revocation": + await HandleRevocation(metadata, payload); + break; + default: + _logger?.LogUnknownMessageType(metadata.MessageType); + break; + } + } + catch (Exception ex) + { + _logger.LogExeption("Error while processing EventSub notification", ex); } } @@ -631,7 +661,7 @@ private async Task OnDataReceived(object sender, DataReceivedArgs e) /// /// Sender of the event. In this case /// EventArgs send with the event. - private async Task OnErrorOccurred(object sender, ErrorOccuredArgs e) + private async Task OnErrorOccurred(object? sender, ErrorOccuredArgs e) { await ErrorOccurred.InvokeAsync(this, e); } @@ -639,23 +669,23 @@ private async Task OnErrorOccurred(object sender, ErrorOccuredArgs e) /// /// Handles 'session_reconnect' notifications /// - /// notification message received from Twitch EventSub - private void HandleReconnect(byte[] message) + private void HandleReconnect(WebsocketEventSubMetadata metadata, JsonElement payload) { + _ = metadata; _logger?.LogReconnectRequested(SessionId); - var data = JsonSerializer.Deserialize(message, _jsonSerializerOptions); + var data = JsonSerializer.Deserialize(payload, _jsonSerializerOptions); _reconnectRequested = true; - Task.Run(async () => await ReconnectAsync(new Uri(data?.Payload.Session.ReconnectUrl ?? WEBSOCKET_URL))); + Task.Run(async () => await ReconnectAsync(new Uri(data?.Session.ReconnectUrl ?? WEBSOCKET_URL))); } /// /// Handles 'session_welcome' notifications /// - /// notification message received from Twitch EventSub - private async ValueTask HandleWelcome(byte[] message) + private async ValueTask HandleWelcome(WebsocketEventSubMetadata metadata, JsonElement payload) { - var data = JsonSerializer.Deserialize(message, _jsonSerializerOptions); + _ = metadata; + var data = JsonSerializer.Deserialize(payload, _jsonSerializerOptions); if (data is null) return; @@ -663,8 +693,8 @@ private async ValueTask HandleWelcome(byte[] message) if (_reconnectRequested) _reconnectComplete = true; - SessionId = data.Payload.Session.Id; - var keepAliveTimeout = data.Payload.Session.KeepaliveTimeoutSeconds + data.Payload.Session.KeepaliveTimeoutSeconds * 0.2; + SessionId = data.Session.Id; + var keepAliveTimeout = data.Session.KeepaliveTimeoutSeconds + data.Session.KeepaliveTimeoutSeconds * 0.2; _keepAliveTimeout = TimeSpan.FromSeconds(keepAliveTimeout ?? 10); @@ -674,73 +704,139 @@ private async ValueTask HandleWelcome(byte[] message) /// /// Handles 'session_disconnect' notifications /// - /// notification message received from Twitch EventSub - private async Task HandleDisconnect(byte[] message) + private async Task HandleDisconnect(WebsocketEventSubMetadata metadata, JsonElement payload) { - var data = JsonSerializer.Deserialize(message); + _ = metadata; + var data = JsonSerializer.Deserialize(payload, _jsonSerializerOptions); if (data != null) - _logger?.LogForceDisconnected(data.Payload.Session.Id, data.Payload.Session.DisconnectedAt, data.Payload.Session.DisconnectReason); + _logger?.LogForceDisconnected(data.Session.Id, data.Session.DisconnectedAt, data.Session.DisconnectReason); - await WebsocketDisconnected.InvokeAsync(this, EventArgs.Empty); + await WebsocketDisconnected.InvokeAsync(this, new()); } /// /// Handles 'session_keepalive' notifications /// - /// notification message received from Twitch EventSub - private void HandleKeepAlive(byte[] message) + private void HandleKeepAlive(WebsocketEventSubMetadata metadata, JsonElement payload) { - _ = message; + _ = metadata; + _ = payload; } /// /// Handles 'notification' notifications /// - /// notification message received from Twitch EventSub - /// subscription type received from Twitch EventSub - private void HandleNotification(string message, string subscriptionType) + private async Task HandleNotificationAsync(WebsocketEventSubMetadata metadata, JsonElement payload) { - if (_handlers.TryGetValue(subscriptionType, out var handler)) - handler(this, message, _jsonSerializerOptions); + if (!metadata.HasSubscriptionInfo) + { + await ErrorOccurred.InvokeAsync(this, new ErrorOccuredArgs { Exception = new ArgumentException("Unable to determine subscription type or subscription version!") }); + return; + } + var task = (metadata.SubscriptionType, metadata.SubscriptionVersion) switch + { + ("automod.message.hold", "1") => InvokeEventSubEvent(AutomodMessageHold), + ("automod.message.hold", "2") => InvokeEventSubEvent(AutomodMessageHoldV2), + ("automod.message.update", "1") => InvokeEventSubEvent(AutomodMessageUpdate), + ("automod.message.update", "2") => InvokeEventSubEvent(AutomodMessageUpdateV2), + ("automod.settings.update", "1") => InvokeEventSubEvent(AutomodSettingsUpdate), + ("automod.terms.update", "1") => InvokeEventSubEvent(AutomodTermsUpdate), + ("channel.bits.use", "1") => InvokeEventSubEvent(ChannelBitsUse), + ("channel.update", "2") => InvokeEventSubEvent(ChannelUpdate), + ("channel.follow", "2") => InvokeEventSubEvent(ChannelFollow), + ("channel.ad_break.begin", "1") => InvokeEventSubEvent(ChannelAdBreakBegin), + ("channel.chat.clear", "1") => InvokeEventSubEvent(ChannelChatClear), + ("channel.chat.clear_user_messages", "1") => InvokeEventSubEvent(ChannelChatClearUserMessages), + ("channel.chat.message", "1") => InvokeEventSubEvent(ChannelChatMessage), + ("channel.chat.message_delete", "1") => InvokeEventSubEvent(ChannelChatMessageDelete), + ("channel.chat.notification", "1") => InvokeEventSubEvent(ChannelChatNotification), + ("channel.chat_settings.update", "1") => InvokeEventSubEvent(ChannelChatSettingsUpdate), + ("channel.chat.user_message_hold", "1") => InvokeEventSubEvent(ChannelChatUserMessageHold), + ("channel.chat.user_message_update", "1") => InvokeEventSubEvent(ChannelChatUserMessageUpdate), + ("channel.shared_chat.begin", "1") => InvokeEventSubEvent(ChannelSharedChatSessionBegin), + ("channel.shared_chat.update", "1") => InvokeEventSubEvent(ChannelSharedChatSessionUpdate), + ("channel.shared_chat.end", "1") => InvokeEventSubEvent(ChannelSharedChatSessionEnd), + ("channel.subscribe", "1") => InvokeEventSubEvent(ChannelSubscribe), + ("channel.subscription.end", "1") => InvokeEventSubEvent(ChannelSubscriptionEnd), + ("channel.subscription.gift", "1") => InvokeEventSubEvent(ChannelSubscriptionGift), + ("channel.subscription.message", "1") => InvokeEventSubEvent(ChannelSubscriptionMessage), + ("channel.cheer", "1") => InvokeEventSubEvent(ChannelCheer), + ("channel.raid", "1") => InvokeEventSubEvent(ChannelRaid), + ("channel.ban", "1") => InvokeEventSubEvent(ChannelBan), + ("channel.unban", "1") => InvokeEventSubEvent(ChannelUnban), + ("channel.unban_request.create", "1") => InvokeEventSubEvent(ChannelUnbanRequestCreate), + ("channel.unban_request.resolve", "1") => InvokeEventSubEvent(ChannelUnbanRequestResolve), + ("channel.moderate", "1") => InvokeEventSubEvent(ChannelModerate), + ("channel.moderate", "2") => InvokeEventSubEvent(ChannelModerateV2), + ("channel.moderator.add", "1") => InvokeEventSubEvent(ChannelModeratorAdd), + ("channel.moderator.remove", "1") => InvokeEventSubEvent(ChannelModeratorRemove), + ("channel.guest_star_session.begin", "beta") => InvokeEventSubEvent(ChannelGuestStarSessionBegin), + ("channel.guest_star_session.end", "beta") => InvokeEventSubEvent(ChannelGuestStarSessionEnd), + ("channel.guest_star_guest.update", "beta") => InvokeEventSubEvent(ChannelGuestStarGuestUpdate), + ("channel.guest_star_settings.update", "beta") => InvokeEventSubEvent(ChannelGuestStarSettingsUpdate), + ("channel.channel_points_automatic_reward_redemption.add", "1") => InvokeEventSubEvent(ChannelPointsAutomaticRewardRedemptionAdd), + ("channel.channel_points_automatic_reward_redemption.add", "2") => InvokeEventSubEvent(ChannelPointsAutomaticRewardRedemptionAddV2), + ("channel.channel_points_custom_reward.add", "1") => InvokeEventSubEvent(ChannelPointsCustomRewardAdd), + ("channel.channel_points_custom_reward.update", "1") => InvokeEventSubEvent(ChannelPointsCustomRewardUpdate), + ("channel.channel_points_custom_reward.remove", "1") => InvokeEventSubEvent(ChannelPointsCustomRewardRemove), + ("channel.channel_points_custom_reward_redemption.add", "1") => InvokeEventSubEvent(ChannelPointsCustomRewardRedemptionAdd), + ("channel.channel_points_custom_reward_redemption.update", "1") => InvokeEventSubEvent(ChannelPointsCustomRewardRedemptionUpdate), + ("channel.poll.begin", "1") => InvokeEventSubEvent(ChannelPollBegin), + ("channel.poll.progress", "1") => InvokeEventSubEvent(ChannelPollProgress), + ("channel.poll.end", "1") => InvokeEventSubEvent(ChannelPollEnd), + ("channel.prediction.begin", "1") => InvokeEventSubEvent(ChannelPredictionBegin), + ("channel.prediction.progress", "1") => InvokeEventSubEvent(ChannelPredictionProgress), + ("channel.prediction.lock", "1") => InvokeEventSubEvent(ChannelPredictionLock), + ("channel.prediction.end", "1") => InvokeEventSubEvent(ChannelPredictionEnd), + ("channel.suspicious_user.message", "1") => InvokeEventSubEvent(ChannelSuspiciousUserMessage), + ("channel.suspicious_user.update", "1") => InvokeEventSubEvent(ChannelSuspiciousUserUpdate), + ("channel.vip.add", "1") => InvokeEventSubEvent(ChannelVipAdd), + ("channel.vip.remove", "1") => InvokeEventSubEvent(ChannelVipRemove), + ("channel.warning.acknowledge", "1") => InvokeEventSubEvent(ChannelWarningAcknowledge), + ("channel.warning.send", "1") => InvokeEventSubEvent(ChannelWarningSend), + ("channel.charity_campaign.donate", "1") => InvokeEventSubEvent(ChannelCharityCampaignDonate), + ("channel.charity_campaign.start", "1") => InvokeEventSubEvent(ChannelCharityCampaignStart), + ("channel.charity_campaign.progress", "1") => InvokeEventSubEvent(ChannelCharityCampaignProgress), + ("channel.charity_campaign.stop", "1") => InvokeEventSubEvent(ChannelCharityCampaignStop), + ("conduit.shard.disabled", "1") => InvokeEventSubEvent(ConduitShardDisabled), + ("channel.goal.begin", "1") => InvokeEventSubEvent(ChannelGoalBegin), + ("channel.goal.progress", "1") => InvokeEventSubEvent(ChannelGoalProgress), + ("channel.goal.end", "1") => InvokeEventSubEvent(ChannelGoalEnd), + ("channel.hype_train.begin", "2") => InvokeEventSubEvent(ChannelHypeTrainBeginV2), + ("channel.hype_train.progress", "2") => InvokeEventSubEvent(ChannelHypeTrainProgressV2), + ("channel.hype_train.end", "2") => InvokeEventSubEvent(ChannelHypeTrainEndV2), + ("channel.shield_mode.begin", "1") => InvokeEventSubEvent(ChannelShieldModeBegin), + ("channel.shield_mode.end", "1") => InvokeEventSubEvent(ChannelShieldModeEnd), + ("channel.shoutout.create", "1") => InvokeEventSubEvent(ChannelShoutoutCreate), + ("channel.shoutout.receive", "1") => InvokeEventSubEvent(ChannelShoutoutReceive), + ("stream.online", "1") => InvokeEventSubEvent(StreamOnline), + ("stream.offline", "1") => InvokeEventSubEvent(StreamOffline), + ("user.update", "1") => InvokeEventSubEvent(UserUpdate), + ("user.whisper.message", "1") => InvokeEventSubEvent(UserWhisperMessage), + _ => InvokeEventSubEvent(UnknownEventSubNotification), + }; + await task; + + async Task InvokeEventSubEvent(AsyncEventHandler? asyncEventHandler) + where TEvent : TwitchLibEventSubNotificationArgs, new() + { + var notification = JsonSerializer.Deserialize>(payload, _jsonSerializerOptions); + await asyncEventHandler.InvokeAsync(this, new TEvent { Metadata = metadata, Payload = notification }); + } } /// /// Handles 'revocation' notifications /// - /// notification message received from Twitch EventSub - private void HandleRevocation(string message) + private async Task HandleRevocation(WebsocketEventSubMetadata metadata, JsonElement payload) { - if (_handlers.TryGetValue("revocation", out var handler)) - handler(this, message, _jsonSerializerOptions); - } + var data = JsonSerializer.Deserialize>(payload, _jsonSerializerOptions); - /// - /// Raises an event from this class from a handler by reflection - /// - /// name of the event to raise - /// args to pass with the event - internal async void RaiseEvent(string eventName, object? args = null) - { - var fInfo = GetType().GetField(eventName, BindingFlags.Instance | BindingFlags.NonPublic); - - if (fInfo?.GetValue(this) is not MulticastDelegate multi) - return; + if (data is null) + throw new InvalidOperationException("Parsed JSON cannot be null!"); - var parameters = new object[] { this, args ?? EventArgs.Empty }; - foreach (var del in multi.GetInvocationList()) - { - try - { - var result = del.Method.Invoke(del.Target, parameters); - if (result is Task task) - await task; - } - catch (Exception ex) - { - _logger.LogRaiseEventExeption(eventName, ex); - } - } + await Revocation?.InvokeAsync(this, new RevocationArgs { Metadata = metadata, Payload = data }); } } } diff --git a/TwitchLib.EventSub.Websockets/Extensions/LogExtensions.cs b/TwitchLib.EventSub.Websockets/Extensions/LogExtensions.cs index 9203519..1ffcc05 100644 --- a/TwitchLib.EventSub.Websockets/Extensions/LogExtensions.cs +++ b/TwitchLib.EventSub.Websockets/Extensions/LogExtensions.cs @@ -10,8 +10,8 @@ internal static partial class LogExtensions { const LogLevel LogMessageLogLevel = LogLevel.Debug; - [LoggerMessage(LogLevel.Error, "Exeption was throw when raising '{eventName}' event.")] - public static partial void LogRaiseEventExeption(this ILogger logger, string eventName, Exception ex); + [LoggerMessage(LogLevel.Error, "{message}")] + public static partial void LogExeption(this ILogger logger, string message, Exception ex); [LoggerMessage(LogMessageLogLevel, "{message}")] public static partial void LogMessage(this ILogger logger, string message); @@ -28,8 +28,8 @@ internal static partial class LogExtensions [LoggerMessage(LogLevel.Warning, "Found unknown message type: {messageType}")] public static partial void LogUnknownMessageType(this ILogger logger, string messageType); - [LoggerMessage(LogLevel.Critical, "{closeStatus} - {closeStatusDescription}")] - public static partial void LogWebsocketClosed(this ILogger logger, WebSocketCloseStatus closeStatus, string closeStatusDescription); + [LoggerMessage("{closeStatus} - {closeStatusDescription}")] + public static partial void LogWebsocketClosed(this ILogger logger, LogLevel logLevel, WebSocketCloseStatus closeStatus, string closeStatusDescription); public static void LogMessage(this ILogger logger, byte[] message) { diff --git a/TwitchLib.EventSub.Websockets/Extensions/ServiceCollectionExtensions.cs b/TwitchLib.EventSub.Websockets/Extensions/ServiceCollectionExtensions.cs index a8f4ce1..14c2b79 100644 --- a/TwitchLib.EventSub.Websockets/Extensions/ServiceCollectionExtensions.cs +++ b/TwitchLib.EventSub.Websockets/Extensions/ServiceCollectionExtensions.cs @@ -1,11 +1,8 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -using System; -using System.Collections.Generic; -using System.Linq; using Microsoft.Extensions.Logging; +using System; using TwitchLib.EventSub.Websockets.Client; -using TwitchLib.EventSub.Websockets.Core.Handler; namespace TwitchLib.EventSub.Websockets.Extensions { @@ -14,28 +11,6 @@ namespace TwitchLib.EventSub.Websockets.Extensions /// public static class ServiceCollectionExtensions { - /// - /// - /// - /// ServiceCollection of the DI Container - /// Array of types in which assemblies to search for NotificationHandlers - /// the IServiceCollection to enable further fluent additions to it - private static IServiceCollection AddNotificationHandlers(this IServiceCollection services, params Type[] scanMarkers) - { - foreach (var marker in scanMarkers) - { - var types = marker - .Assembly.DefinedTypes - .Where(x => typeof(INotificationHandler).IsAssignableFrom(x) && !x.IsInterface && !x.IsAbstract) - .ToList(); - - foreach (var type in types) - services.AddSingleton(typeof(INotificationHandler), type); - } - - return services; - } - /// /// Add TwitchLib EventSub Websockets and its needed parts to the DI container /// @@ -44,9 +19,8 @@ private static IServiceCollection AddNotificationHandlers(this IServiceCollectio public static IServiceCollection AddTwitchLibEventSubWebsockets(this IServiceCollection services) { services.TryAddTransient(); - services.TryAddSingleton(x => new EventSubWebsocketClient(x.GetRequiredService>(), x.GetRequiredService>(), x.GetRequiredService(), x.GetRequiredService())); - services.AddNotificationHandlers(typeof(INotificationHandler)); + services.TryAddSingleton(x => new EventSubWebsocketClient(x.GetRequiredService>(), x.GetRequiredService(), x.GetRequiredService())); return services; } } -} \ No newline at end of file +} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Ads/AdBreakBeginHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Ads/AdBreakBeginHandler.cs deleted file mode 100644 index e2095b8..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Ads/AdBreakBeginHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Ads -{ - /// - /// Handler for 'channel.ad_break.begin' notifications - /// - public class AdBreakBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.ad_break.begin"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - client.RaiseEvent("ChannelAdBreakBegin", new ChannelAdBreakBeginArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardAddHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardAddHandler.cs deleted file mode 100644 index fd88645..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardAddHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.ChannelPoints.CustomReward -{ - /// - /// Handler for 'channel.channel_points_custom_reward.add' notifications - /// - public class ChannelPointsCustomRewardAddHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.channel_points_custom_reward.add"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPointsCustomRewardAdd", new ChannelPointsCustomRewardArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardRemoveHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardRemoveHandler.cs deleted file mode 100644 index be75e4f..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardRemoveHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.ChannelPoints.CustomReward -{ - /// - /// Handler for 'channel.channel_points_custom_reward.remove' notifications - /// - public class ChannelPointsCustomRewardRemoveHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.channel_points_custom_reward.remove"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPointsCustomRewardRemove", new ChannelPointsCustomRewardArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardUpdateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardUpdateHandler.cs deleted file mode 100644 index e10d0ab..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/CustomReward/ChannelPointsCustomRewardUpdateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.ChannelPoints.CustomReward -{ - /// - /// Handler for 'channel.channel_points_custom_reward.update' notifications - /// - public class ChannelPointsCustomRewardUpdateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.channel_points_custom_reward.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPointsCustomRewardUpdate", new ChannelPointsCustomRewardArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsAutomaticRewardRedemptionAddHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsAutomaticRewardRedemptionAddHandler.cs deleted file mode 100644 index 6ae04f6..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsAutomaticRewardRedemptionAddHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.ChannelPoints.Redemptions; -/// -/// Handler for 'channel.channel_points_automatic_reward_redemption.add' notifications -/// -public class ChannelPointsAutomaticRewardRedemptionAddHandler : INotificationHandler -{ - /// - public string SubscriptionType => "channel.channel_points_automatic_reward_redemption.add"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPointsAutomaticRewardRedemptionAdd", new ChannelPointsAutomaticRewardRedemptionArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsCustomRewardRedemptionAddHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsCustomRewardRedemptionAddHandler.cs deleted file mode 100644 index a99bc27..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsCustomRewardRedemptionAddHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.ChannelPoints.Redemptions -{ - /// - /// Handler for 'channel.channel_points_custom_reward_redemption.add' notifications - /// - public class ChannelPointsCustomRewardRedemptionAddHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.channel_points_custom_reward_redemption.add"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPointsCustomRewardRedemptionAdd", new ChannelPointsCustomRewardRedemptionArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsCustomRewardRedemptionUpdate.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsCustomRewardRedemptionUpdate.cs deleted file mode 100644 index afbfaf3..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelPoints/Redemptions/ChannelPointsCustomRewardRedemptionUpdate.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.ChannelPoints.Redemptions -{ - /// - /// Handler for 'channel.channel_points_custom_reward_redemption.update' notifications - /// - public class ChannelPointsCustomRewardRedemptionUpdate : INotificationHandler - { - /// - public string SubscriptionType => "channel.channel_points_custom_reward_redemption.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPointsCustomRewardRedemptionUpdate", new ChannelPointsCustomRewardRedemptionArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelUpdateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelUpdateHandler.cs deleted file mode 100644 index 3bc1971..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ChannelUpdateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel -{ - /// - /// Handler for 'channel.update' notifications - /// - public class ChannelUpdateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelUpdate", new ChannelUpdateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignDonateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignDonateHandler.cs deleted file mode 100644 index 6b6d4bc..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignDonateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Charity -{ - /// - /// Handler for 'channel.charity_campaign.donate' notifications - /// - public class ChannelCharityCampaignDonateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.charity_campaign.donate"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelCharityCampaignDonate", new ChannelCharityCampaignDonateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignProgressHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignProgressHandler.cs deleted file mode 100644 index 00f7893..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignProgressHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Charity -{ - /// - /// Handler for 'channel.charity_campaign.progress' notifications - /// - public class ChannelCharityCampaignProgressHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.charity_campaign.progress"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelCharityCampaignProgress", new ChannelCharityCampaignProgressArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignStartHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignStartHandler.cs deleted file mode 100644 index b79cd7e..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignStartHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Charity -{ - /// - /// Handler for 'channel.charity_campaign.start' notifications - /// - public class ChannelCharityCampaignStartHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.charity_campaign.start"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelCharityCampaignStart", new ChannelCharityCampaignStartArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignStopHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignStopHandler.cs deleted file mode 100644 index ca1c444..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Charity/ChannelCharityCampaignStopHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Charity -{ - /// - /// Handler for 'channel.charity_campaign.stop' notifications - /// - public class ChannelCharityCampaignStopHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.charity_campaign.stop"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelCharityCampaignStop", new ChannelCharityCampaignStopArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChannelChatClearHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChannelChatClearHandler.cs deleted file mode 100644 index 5fd0d20..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChannelChatClearHandler.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Chat; - -/// -/// Handler for 'channel.chat.clear' notifications -/// -public class ChannelChatClearHandler : INotificationHandler -{ - /// - public string SubscriptionType => "channel.chat.clear"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelChatClear", new ChannelChatClearArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChannelChatClearUserMessagesHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChannelChatClearUserMessagesHandler.cs deleted file mode 100644 index 2931c65..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChannelChatClearUserMessagesHandler.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Chat; - -/// -/// Handler for 'channel.chat.clear_user_messages' notifications -/// -public class ChannelChatClearUserMessagesHandler : INotificationHandler -{ - /// - public string SubscriptionType => "channel.chat.clear_user_messages"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelChatClearUserMessages", new ChannelChatClearUserMessagesArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChatMessageDeleteHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChatMessageDeleteHandler.cs deleted file mode 100644 index 980cba1..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChatMessageDeleteHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Chat -{ - /// - /// Handler for 'channel.chat.message_delete' notifications - /// - public class ChatMessageDeleteHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.chat.message_delete"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - client.RaiseEvent("ChannelChatMessageDelete", new ChannelChatMessageDeleteArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChatNotificationHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChatNotificationHandler.cs deleted file mode 100644 index 9e401ed..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Chat/ChatNotificationHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Chat -{ - /// - /// Handler for 'channel.chat.notification' notifications - /// - public class ChatNotificationHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.chat.notification"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - client.RaiseEvent("ChannelChatNotification", new ChannelChatNotificationArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ChatMessageHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ChatMessageHandler.cs deleted file mode 100644 index 07f5a6c..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ChatMessageHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel -{ - /// - /// Handler for 'channel.chat.nessage' notifications - /// - public class ChatMessageHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.chat.message"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - client.RaiseEvent("ChannelChatMessage", new ChannelChatMessageArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Cheers/ChannelCheerHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Cheers/ChannelCheerHandler.cs deleted file mode 100644 index e947772..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Cheers/ChannelCheerHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Cheers -{ - /// - /// Handler for 'channel.cheer' notifications - /// - public class ChannelCheerHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.cheer"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelCheer", new ChannelCheerArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Follows/ChannelFollowHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Follows/ChannelFollowHandler.cs deleted file mode 100644 index e5d7a24..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Follows/ChannelFollowHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Follows -{ - /// - /// Handler for 'channel.follow' notifications - /// - public class ChannelFollowHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.follow"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelFollow", new ChannelFollowArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.follow notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalBeginHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalBeginHandler.cs deleted file mode 100644 index ccc4c7d..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalBeginHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Goals -{ - /// - /// Handler for 'channel.goal.begin' notifications - /// - public class ChannelGoalBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.goal.begin"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelGoalBegin", new ChannelGoalBeginArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalEndHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalEndHandler.cs deleted file mode 100644 index beccda2..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalEndHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Goals -{ - /// - /// Handler for 'channel.goal.end' notifications - /// - public class ChannelGoalEndHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.goal.end"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelGoalEnd", new ChannelGoalEndArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalProgressHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalProgressHandler.cs deleted file mode 100644 index a5997d1..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Goals/ChannelGoalProgressHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Goals -{ - /// - /// Handler for 'channel.goal.progress' notifications - /// - public class ChannelGoalProgressHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.goal.progress"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelGoalProgress", new ChannelGoalProgressArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarGuestUpdateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarGuestUpdateHandler.cs deleted file mode 100644 index de87381..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarGuestUpdateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.GuestStar -{ - /// - /// Handler for 'channel.guest_star_guest.update' notifications - /// - public class ChannelGuestStarGuestUpdateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.guest_star_guest.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelGuestStarGuestUpdate", new ChannelGuestStarGuestUpdateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.guest_star_guest.update notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSessionBeginHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSessionBeginHandler.cs deleted file mode 100644 index 7d82f12..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSessionBeginHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.GuestStar -{ - /// - /// Handler for 'channel.guest_star_session.begin' notifications - /// - public class ChannelGuestStarSessionBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.guest_star_session.begin"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelGuestStarSessionBegin", new ChannelGuestStarSessionBeginArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.guest_star_session.begin notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSessionEndHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSessionEndHandler.cs deleted file mode 100644 index 8cbc2d4..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSessionEndHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.GuestStar -{ - /// - /// Handler for 'channel.guest_star_session.end' notifications - /// - public class ChannelGuestStarSessionEndHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.guest_star_session.end"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelGuestStarSessionEnd", new ChannelGuestStarSessionEndArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.guest_star_session.end notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSettingsUpdateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSettingsUpdateHandler.cs deleted file mode 100644 index bb9dabc..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSettingsUpdateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.GuestStar -{ - /// - /// Handler for 'channel.guest_star_slot.update' notifications - /// - public class ChannelGuestStarSettingsUpdateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.guest_star_settings.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelGuestStarSettingsUpdate", new ChannelGuestStarSettingsUpdateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.guest_star_settings.update notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSlotUpdateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSlotUpdateHandler.cs deleted file mode 100644 index d4ca313..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/GuestStar/ChannelGuestStarSlotUpdateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.GuestStar -{ - /// - /// Handler for 'channel.guest_star_slot.update' notifications - /// - public class ChannelGuestStarSlotUpdateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.guest_star_slot.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelGuestStarSlotUpdate", new ChannelGuestStarSlotUpdateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.guest_star_slot.update notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainBeginHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainBeginHandler.cs deleted file mode 100644 index f3ee228..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainBeginHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.HypeTrains -{ - /// - /// Handler for 'channel.hype_train.begin' notifications - /// - public class ChannelHypeTrainBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.hype_train.begin"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelHypeTrainBegin", new ChannelHypeTrainBeginArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainEndHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainEndHandler.cs deleted file mode 100644 index 3c05fa8..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainEndHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.HypeTrains -{ - /// - /// Handler for 'channel.hype_train.end' notifications - /// - public class ChannelHypeTrainEndHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.hype_train.end"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelHypeTrainEnd", new ChannelHypeTrainEndArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainProgressHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainProgressHandler.cs deleted file mode 100644 index fdd1b91..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/HypeTrains/ChannelHypeTrainProgressHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.HypeTrains -{ - /// - /// Handler for 'channel.hype_train.progress' notifications - /// - public class ChannelHypeTrainProgressHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.hype_train.progress"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelHypeTrainProgress", new ChannelHypeTrainProgressArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelBanHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelBanHandler.cs deleted file mode 100644 index 464e3f8..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelBanHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Moderation -{ - /// - /// Handler for 'channel.ban' notifications - /// - public class ChannelBanHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.ban"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelBan", new ChannelBanArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanHandler.cs deleted file mode 100644 index 20877ef..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Moderation -{ - /// - /// Handler for 'channel.unban' notifications - /// - public class ChannelUnbanHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.unban"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelUnban", new ChannelUnbanArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanRequestCreateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanRequestCreateHandler.cs deleted file mode 100644 index 2e0e8f7..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanRequestCreateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Moderation -{ - /// - /// Handler for 'channel.unban_request.create' notifications - /// - public class ChannelUnbanRequestCreateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.unban_request.create"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelUnbanRequestCreate", new ChannelUnbanRequestCreateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanRequestResolveHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanRequestResolveHandler.cs deleted file mode 100644 index 411da7e..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderation/ChannelUnbanRequestResolveHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Moderation -{ - /// - /// Handler for 'channel.unban_request.resolve' notifications - /// - public class ChannelUnbanRequestResolveHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.unban_request.resolve"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelUnbanRequestResolve", new ChannelUnbanRequestResolveArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderators/ChannelModeratorAddHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Moderators/ChannelModeratorAddHandler.cs deleted file mode 100644 index e2e6856..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderators/ChannelModeratorAddHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Moderators -{ - /// - /// Handler for 'channel.moderator.add' notifications - /// - public class ChannelModeratorAddHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.moderator.add"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelModeratorAdd", new ChannelModeratorArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderators/ChannelModeratorRemoveHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Moderators/ChannelModeratorRemoveHandler.cs deleted file mode 100644 index 7b8e919..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Moderators/ChannelModeratorRemoveHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Moderators -{ - /// - /// Handler for 'channel.moderator.remove' notifications - /// - public class ChannelModeratorRemoveHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.moderator.remove"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelModeratorRemove", new ChannelModeratorArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollBeginHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollBeginHandler.cs deleted file mode 100644 index a8d1788..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollBeginHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Polls -{ - /// - /// Handler for 'channel.poll.begin' notifications - /// - public class ChannelPollBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.poll.begin"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPollBegin", new ChannelPollBeginArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollEndHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollEndHandler.cs deleted file mode 100644 index a7b6bda..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollEndHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Polls -{ - /// - /// Handler for 'channel.poll.end' notifications - /// - public class ChannelPollEndHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.poll.end"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPollEnd", new ChannelPollEndArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollProgressHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollProgressHandler.cs deleted file mode 100644 index 2b7e270..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Polls/ChannelPollProgressHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Polls -{ - /// - /// Handler for 'channel.poll.progress' notifications - /// - public class ChannelPollProgressHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.poll.progress"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPollProgress", new ChannelPollProgressArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionBeginHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionBeginHandler.cs deleted file mode 100644 index 070c6d5..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionBeginHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Predictions -{ - /// - /// Handler for 'channel.prediction.begin' notifications - /// - public class ChannelPredictionBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.prediction.begin"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPredictionBegin", new ChannelPredictionBeginArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionEndHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionEndHandler.cs deleted file mode 100644 index 8817c87..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionEndHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Predictions -{ - /// - /// Handler for 'channel.prediction.end' notifications - /// - public class ChannelPredictionEndHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.prediction.end"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPredictionEnd", new ChannelPredictionEndArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionLockHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionLockHandler.cs deleted file mode 100644 index d23f1ca..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionLockHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Predictions -{ - /// - /// Handler for 'channel.prediction.lock' notifications - /// - public class ChannelPredictionLockBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.prediction.lock"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPredictionLock", new ChannelPredictionLockArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionProgressHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionProgressHandler.cs deleted file mode 100644 index 1876c1c..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Predictions/ChannelPredictionProgressHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Predictions -{ - /// - /// Handler for 'channel.prediction.progress' notifications - /// - public class ChannelPredictionProgressHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.prediction.progress"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelPredictionProgress", new ChannelPredictionProgressArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Raids/ChannelRaidHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Raids/ChannelRaidHandler.cs deleted file mode 100644 index d4d7d44..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Raids/ChannelRaidHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Raids -{ - /// - /// Handler for 'channel.raid' notifications - /// - public class ChannelRaidHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.raid"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelRaid", new ChannelRaidArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionBeginHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionBeginHandler.cs deleted file mode 100644 index ea2f3e1..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionBeginHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.SharedChat -{ - /// - /// Handler for 'channel.shared_chat.begin' notifications - /// - public class ChannelSharedChatSessionBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.shared_chat.begin"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSharedChatSessionBegin", new ChannelSharedChatSessionBeginArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.shared_chat.begin notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionEndHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionEndHandler.cs deleted file mode 100644 index ef0e972..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionEndHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.SharedChat -{ - /// - /// Handler for 'channel.shared_chat.end' notifications - /// - public class ChannelSharedChatSessionEndHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.shared_chat.end"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSharedChatSessionEnd", new ChannelSharedChatSessionEndArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.shared_chat.end notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionUpdateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionUpdateHandler.cs deleted file mode 100644 index 0047e0b..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/SharedChat/ChannelSharedChatSessionUpdateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.SharedChat -{ - /// - /// Handler for 'channel.shared_chat.update' notifications - /// - public class ChannelSharedChatSessionUpdateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.shared_chat.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSharedChatSessionUpdate", new ChannelSharedChatSessionUpdateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle channel.shared_chat.update notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ShieldMode/ChannelShieldModeBeginHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ShieldMode/ChannelShieldModeBeginHandler.cs deleted file mode 100644 index aa26e4e..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ShieldMode/ChannelShieldModeBeginHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.ShieldMode -{ - /// - /// Handler for 'channel.shield_mode.begin' notifications - /// - public class ChannelShieldModeBeginHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.shield_mode.begin"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelShieldModeBegin", new ChannelShieldModeBeginArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/ShieldMode/ChannelShieldModeEndHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/ShieldMode/ChannelShieldModeEndHandler.cs deleted file mode 100644 index 69f5c58..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/ShieldMode/ChannelShieldModeEndHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.ShieldMode -{ - /// - /// Handler for 'channel.shield_mode.end' notifications - /// - public class ChannelShieldModeEndHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.shield_mode.end"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelShieldModeEnd", new ChannelShieldModeEndArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Shoutouts/ChannelShoutoutCreateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Shoutouts/ChannelShoutoutCreateHandler.cs deleted file mode 100644 index 5d30bf7..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Shoutouts/ChannelShoutoutCreateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Shoutouts -{ - /// - /// Handler for 'channel.shoutout.create' notifications - /// - public class ChannelShoutoutCreateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.shoutout.create"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelShoutoutCreate", new ChannelShoutoutCreateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Shoutouts/ChannelShoutoutReceiveHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Shoutouts/ChannelShoutoutReceiveHandler.cs deleted file mode 100644 index 20ed088..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Shoutouts/ChannelShoutoutReceiveHandler.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Shoutouts -{ - /// - /// Handler for 'channel.shoutout.receive' notifications - /// - public class ChannelShoutoutReceiveHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.shoutout.receive"; - - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelShoutoutReceive", new ChannelShoutoutReceiveArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscribeHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscribeHandler.cs deleted file mode 100644 index 90a73a6..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscribeHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Subscription -{ - /// - /// Handler for 'channel.subscribe' notifications - /// - public class ChannelSubscribeHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.subscribe"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSubscribe", new ChannelSubscribeArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionEndHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionEndHandler.cs deleted file mode 100644 index 2979325..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionEndHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Subscription -{ - /// - /// Handler for 'channel.subscription.end' notifications - /// - public class ChannelSubscriptionEndHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.subscription.end"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSubscriptionEnd", new ChannelSubscriptionEndArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionGiftHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionGiftHandler.cs deleted file mode 100644 index ad19ff7..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionGiftHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Subscription -{ - /// - /// Handler for 'channel.subscription.gift' notifications - /// - public class ChannelSubscriptionGiftHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.subscription.gift"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSubscriptionGift", new ChannelSubscriptionGiftArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionMessageHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionMessageHandler.cs deleted file mode 100644 index 44fe236..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Subscription/ChannelSubscriptionMessageHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Subscription -{ - /// - /// Handler for 'channel.subscription.message' notifications - /// - public class ChannelSubscriptionMessageHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.subscription.message"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSubscriptionMessage", new ChannelSubscriptionMessageArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/SuspiciousUser/ChannelSuspiciousUserMessageHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/SuspiciousUser/ChannelSuspiciousUserMessageHandler.cs deleted file mode 100644 index 8616f65..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/SuspiciousUser/ChannelSuspiciousUserMessageHandler.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.SuspiciousUser -{ - /// - /// Handler for 'channel.suspicious_user.message' notifications - /// - public class ChannelSuspiciousUserMessageHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.suspicious_user.message"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSuspiciousUserMessage", new ChannelSuspiciousUserMessageArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/SuspiciousUser/ChannelSuspiciousUserUpdateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/SuspiciousUser/ChannelSuspiciousUserUpdateHandler.cs deleted file mode 100644 index af11ae8..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/SuspiciousUser/ChannelSuspiciousUserUpdateHandler.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.SuspiciousUser -{ - /// - /// Handler for 'channel.suspicious_user.update' notifications - /// - public class ChannelSuspiciousUserUpdateHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.suspicious_user.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelSuspiciousUserUpdate", new ChannelSuspiciousUserUpdateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Vips/ChannelVipAddHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Vips/ChannelVipAddHandler.cs deleted file mode 100644 index 1b11576..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Vips/ChannelVipAddHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Vips -{ - /// - /// Handler for 'channel.vip.add' notifications - /// - public class ChannelVipAddHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.vip.add"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelVipAdd", new ChannelVipArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Vips/ChannelVipRemoveHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Vips/ChannelVipRemoveHandler.cs deleted file mode 100644 index 34bb979..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Vips/ChannelVipRemoveHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Vips -{ - /// - /// Handler for 'channel.vip.remove' notifications - /// - public class ChannelVipRemoveHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.vip.remove"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelVipRemove", new ChannelVipArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Warning/ChannelWarningAcknowledgeHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Warning/ChannelWarningAcknowledgeHandler.cs deleted file mode 100644 index b6787f5..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Warning/ChannelWarningAcknowledgeHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Warning -{ - /// - /// Handler for 'channel.warning.acknowledge' notifications - /// - public class ChannelWarningAcknowledgeHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.warning.acknowledge"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelWarningAcknowledge", new ChannelWarningAcknowledgeArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/Channel/Warning/ChannelWarningSendHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Channel/Warning/ChannelWarningSendHandler.cs deleted file mode 100644 index 236d9c9..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Channel/Warning/ChannelWarningSendHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Channel; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Channel; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Channel.Warning -{ - /// - /// Handler for 'channel.warning.send' notifications - /// - public class ChannelWarningSendHandler : INotificationHandler - { - /// - public string SubscriptionType => "channel.warning.send"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("ChannelWarningSend", new ChannelWarningSendArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/RevocationHandler.cs b/TwitchLib.EventSub.Websockets/Handler/RevocationHandler.cs deleted file mode 100644 index 9d35bc8..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/RevocationHandler.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler -{ - /// - /// Handler for 'revocation' notifications - /// - public class RevocationHandler : INotificationHandler - { - /// - public string SubscriptionType => "revocation"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("Revocation", new RevocationArgs { Notification = data }); - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Stream/StreamOfflineHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Stream/StreamOfflineHandler.cs deleted file mode 100644 index 0a8a82a..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Stream/StreamOfflineHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Stream; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Stream; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Stream -{ - /// - /// Handler for 'stream.offline' notifications - /// - public class StreamOfflineHandler : INotificationHandler - { - /// - public string SubscriptionType => "stream.offline"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("StreamOffline", new StreamOfflineArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/Stream/StreamOnlineHandler.cs b/TwitchLib.EventSub.Websockets/Handler/Stream/StreamOnlineHandler.cs deleted file mode 100644 index 3e5aa94..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/Stream/StreamOnlineHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.Stream; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.Stream; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.Stream -{ - /// - /// Handler for 'stream.online' notifications - /// - public class StreamOnlineHandler : INotificationHandler - { - /// - public string SubscriptionType => "stream.online"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("StreamOnline", new StreamOnlineArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} \ No newline at end of file diff --git a/TwitchLib.EventSub.Websockets/Handler/User/UserUpdateHandler.cs b/TwitchLib.EventSub.Websockets/Handler/User/UserUpdateHandler.cs deleted file mode 100644 index 47a436e..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/User/UserUpdateHandler.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.User; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.User; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.User -{ - /// - /// Handler for 'user.update' notifications - /// - public class UserUpdateHandler : INotificationHandler - { - /// - public string SubscriptionType => "user.update"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("UserUpdate", new UserUpdateArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } - } -} diff --git a/TwitchLib.EventSub.Websockets/Handler/User/UserWhisperMessageHandler.cs b/TwitchLib.EventSub.Websockets/Handler/User/UserWhisperMessageHandler.cs deleted file mode 100644 index 24367f9..0000000 --- a/TwitchLib.EventSub.Websockets/Handler/User/UserWhisperMessageHandler.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Text.Json; -using TwitchLib.EventSub.Core.SubscriptionTypes.User; -using TwitchLib.EventSub.Websockets.Core.EventArgs; -using TwitchLib.EventSub.Websockets.Core.EventArgs.User; -using TwitchLib.EventSub.Websockets.Core.Handler; -using TwitchLib.EventSub.Websockets.Core.Models; - -namespace TwitchLib.EventSub.Websockets.Handler.User; - -/// -/// Handler for 'user.whisper.message' notifications -/// -public class UserWhisperMessageHandler : INotificationHandler -{ - /// - public string SubscriptionType => "user.whisper.message"; - - /// - public void Handle(EventSubWebsocketClient client, string jsonString, JsonSerializerOptions serializerOptions) - { - try - { - var data = JsonSerializer.Deserialize>(jsonString.AsSpan(), serializerOptions); - - if (data is null) - throw new InvalidOperationException("Parsed JSON cannot be null!"); - - client.RaiseEvent("UserWhisperMessage", new UserWhisperMessageArgs { Notification = data }); - } - catch (Exception ex) - { - client.RaiseEvent("ErrorOccurred", new ErrorOccuredArgs { Exception = ex, Message = $"Error encountered while trying to handle {SubscriptionType} notification! Raw Json: {jsonString}" }); - } - } -} diff --git a/TwitchLib.EventSub.Websockets/TwitchLib.EventSub.Websockets.csproj b/TwitchLib.EventSub.Websockets/TwitchLib.EventSub.Websockets.csproj index 8daedb8..2b9938f 100644 --- a/TwitchLib.EventSub.Websockets/TwitchLib.EventSub.Websockets.csproj +++ b/TwitchLib.EventSub.Websockets/TwitchLib.EventSub.Websockets.csproj @@ -1,23 +1,23 @@  - netstandard2.0;netstandard2.1;net6.0;net7.0;net8.0 + netstandard2.0;netstandard2.1;net8.0 TwitchLib.EventSub.Websockets TwitchLib.EventSub.Websockets swiftyspiffy, Prom3theu5, Syzuna, LuckyNoS7evin - 0.6.0 + 0.7.0 $(VersionSuffix) - 0.6.0 - 0.6.0 + $(VersionPrefix) + $(VersionPrefix) EventSub Websockets (also known as EventSockets) Client Library https://cdn.syzuna-programs.de/images/twitchlib.png https://github.com/TwitchLib/TwitchLib.EventSub.Websockets https://github.com/TwitchLib/TwitchLib.EventSub.Websockets Git MIT - Copyright 2023 - twitch library events eventsub websockets eventsockets c# csharp netstandard2.0 netstandard2.1 net6.0 net7.0 net8.0 - Updated dependencies, enabled nullable, added new events (ChannelChatClear, ChannelChatClearUserMessages, ChannelChatMessageDelete, ChannelChatNotification, ChannelVipAdd, ChannelVipRemove, ChannelPointsAutomaticRewardRedemptionAdd, ChannelSuspiciousUserMessage, ChannelSuspiciousUserUpdate, ChannelWarningAcknowledge, ChannelWarningSend, UserWhisperMessage, ChannelSharedChatSessionBegin, ChannelSharedChatSessionUpdate, ChannelSharedChatSessionEnd, ChannelUnbanRequestCreate, ChannelUnbanRequestResolve) + Copyright 2025 + twitch library events eventsub websockets eventsockets c# csharp netstandard2.0 netstandard2.1 net8.0 + removed INotificationHandler interface, Removed deprecated versions of .NET, All EventSub events were moved to `TwitchLib.EventSub.Core` Nuget Package, Like Events, all EventSub Models were moved to the `TwitchLib.EventSub.Core` package en-US disable enable @@ -31,8 +31,8 @@ - - + +