From 29c399bb320723e09cfd30644388ae3c82b10d5a Mon Sep 17 00:00:00 2001 From: AoshiW Date: Tue, 7 Nov 2023 18:25:02 +0100 Subject: [PATCH] removing obsolete events --- .../Events/OnChatColorChangedArgs.cs | 24 --------------- .../Events/OnModeratorsReceivedArgs.cs | 28 ------------------ TwitchLib.Client/Events/OnVIPsReceivedArgs.cs | 29 ------------------- TwitchLib.Client/Interfaces/ITwitchClient.cs | 15 ---------- TwitchLib.Client/TwitchClient.cs | 14 --------- 5 files changed, 110 deletions(-) delete mode 100644 TwitchLib.Client/Events/OnChatColorChangedArgs.cs delete mode 100644 TwitchLib.Client/Events/OnModeratorsReceivedArgs.cs delete mode 100644 TwitchLib.Client/Events/OnVIPsReceivedArgs.cs diff --git a/TwitchLib.Client/Events/OnChatColorChangedArgs.cs b/TwitchLib.Client/Events/OnChatColorChangedArgs.cs deleted file mode 100644 index fd40c54d..00000000 --- a/TwitchLib.Client/Events/OnChatColorChangedArgs.cs +++ /dev/null @@ -1,24 +0,0 @@ -namespace TwitchLib.Client.Events -{ - /// - /// Args representing a successful chat color change request. - /// Implements the - /// - /// - /// - public class OnChatColorChangedArgs : EventArgs - { - /// - /// Property reprenting the channel the event was received in. - /// - public string Channel; - - /// - /// Initializes a new instance of the class. - /// - public OnChatColorChangedArgs(string channel) - { - Channel = channel; - } - } -} diff --git a/TwitchLib.Client/Events/OnModeratorsReceivedArgs.cs b/TwitchLib.Client/Events/OnModeratorsReceivedArgs.cs deleted file mode 100644 index 8f0a9612..00000000 --- a/TwitchLib.Client/Events/OnModeratorsReceivedArgs.cs +++ /dev/null @@ -1,28 +0,0 @@ -using TwitchLib.Client.Extensions; - -namespace TwitchLib.Client.Events -{ - /// - /// Args representing a list of moderators received from chat. - /// Implements the - /// - /// - /// - public class OnModeratorsReceivedArgs : NoticeEventArgs - { - /// - /// Property representing an array of moderators. - /// - public string[] Moderators { get; } - - /// - /// Initializes a new instance of the class. - /// - public OnModeratorsReceivedArgs(string channel, string message) : base(channel, message) - { - Moderators = string.IsNullOrEmpty(message) - ? Array.Empty() - : message.SplitFirst(':').Remainder.ToString().Replace(" ", "").Split(','); - } - } -} diff --git a/TwitchLib.Client/Events/OnVIPsReceivedArgs.cs b/TwitchLib.Client/Events/OnVIPsReceivedArgs.cs deleted file mode 100644 index 89f66698..00000000 --- a/TwitchLib.Client/Events/OnVIPsReceivedArgs.cs +++ /dev/null @@ -1,29 +0,0 @@ -using TwitchLib.Client.Extensions; - -namespace TwitchLib.Client.Events -{ - /// - /// Args representing a list of VIPs received from chat. - /// Implements the - /// - /// - /// - public class OnVIPsReceivedArgs : NoticeEventArgs - { - /// - /// Property representing an array of VIPs. - /// - public string[] VIPs { get; } - - /// - /// Initializes a new instance of the class. - /// - public OnVIPsReceivedArgs(string channel, string message) : base(channel, message) - { - // TODO: Make it less allocatey - VIPs = string.IsNullOrEmpty(message) - ? Array.Empty() - : message.SplitFirst(':').Remainder.ToString().Replace(" ", "").Replace(".", "").Split(','); - } - } -} diff --git a/TwitchLib.Client/Interfaces/ITwitchClient.cs b/TwitchLib.Client/Interfaces/ITwitchClient.cs index da8431b8..5e25bf6c 100644 --- a/TwitchLib.Client/Interfaces/ITwitchClient.cs +++ b/TwitchLib.Client/Interfaces/ITwitchClient.cs @@ -68,11 +68,6 @@ public interface ITwitchClient /// event AsyncEventHandler? OnAnnouncement; - /// - /// Fires when VIPs are received from chat - /// - event AsyncEventHandler? OnVIPsReceived; - /// /// Fires when client connects to Twitch. /// @@ -188,16 +183,6 @@ public interface ITwitchClient /// event AsyncEventHandler? OnUserBanned; - /// - /// Fires when a list of moderators is received. - /// - event AsyncEventHandler? OnModeratorsReceived; - - /// - /// Fires when confirmation of a chat color change request was received. - /// - event AsyncEventHandler? OnChatColorChanged; - /// /// Fires when data is either received or sent. /// diff --git a/TwitchLib.Client/TwitchClient.cs b/TwitchLib.Client/TwitchClient.cs index e6ac0ce6..e96d26cc 100644 --- a/TwitchLib.Client/TwitchClient.cs +++ b/TwitchLib.Client/TwitchClient.cs @@ -144,9 +144,6 @@ public class TwitchClient : ITwitchClient /// public event AsyncEventHandler? OnAnnouncement; - /// - public event AsyncEventHandler? OnVIPsReceived; - /// public event AsyncEventHandler? OnConnected; @@ -216,12 +213,6 @@ public class TwitchClient : ITwitchClient /// public event AsyncEventHandler? OnUserBanned; - /// - public event AsyncEventHandler? OnModeratorsReceived; - - /// - public event AsyncEventHandler? OnChatColorChanged; - /// public event AsyncEventHandler? OnSendReceiveData; @@ -936,9 +927,6 @@ private Task HandleNotice(IrcMessage ircMessage) var result = msgId switch { - MsgIds.ColorChanged => OnChatColorChanged?.Invoke(this, new(channel)), - MsgIds.ModeratorsReceived => OnModeratorsReceived?.Invoke(this, new(channel, message)), - MsgIds.NoMods => OnModeratorsReceived?.Invoke(this, new(channel, string.Empty)), MsgIds.NoPermission => OnNoPermissionError?.Invoke(this, new(channel, message)), MsgIds.RaidErrorSelf => OnSelfRaidError?.Invoke(this, new(channel, message)), MsgIds.RaidNoticeMature => OnRaidedChannelIsMatureAudience?.Invoke(this, new(channel, message)), @@ -946,8 +934,6 @@ private Task HandleNotice(IrcMessage ircMessage) MsgIds.MsgChannelSuspended => HandleChannelSuspended(ircMessage), MsgIds.MsgRequiresVerifiedPhoneNumber => OnRequiresVerifiedPhoneNumber?.Invoke(this, new(channel, message)), MsgIds.MsgVerifiedEmail => OnRequiresVerifiedEmail?.Invoke(this, new(channel, message)), - MsgIds.NoVIPs => OnVIPsReceived?.Invoke(this, new(channel, string.Empty)), - MsgIds.VIPsSuccess => OnVIPsReceived?.Invoke(this, new(channel, message)), MsgIds.MsgRateLimit => OnRateLimit?.Invoke(this, new(channel, message)), MsgIds.MsgDuplicate => OnDuplicate?.Invoke(this, new(channel, message)), MsgIds.MsgFollowersOnly => OnFollowersOnly?.Invoke(this, new(channel, message)),