From f7278c6d3f0e5babaa956a0525b43bc353170443 Mon Sep 17 00:00:00 2001 From: barelyprofessional <150058423+barelyprofessional@users.noreply.github.com> Date: Mon, 17 Jun 2024 19:07:24 +0800 Subject: [PATCH] Updated reconnection logic to always fire even if it's an initial "reconnection". This is to avoid the bot lingering outside the channel after fetching a fresh token as it was triggering a ByUser reconnect then an Initial reconnect and therefore not sending the join message. --- KfChatDotNetKickBot/KickBot.cs | 1 - KfChatDotNetWsClient/ChatClient.cs | 5 ----- 2 files changed, 6 deletions(-) diff --git a/KfChatDotNetKickBot/KickBot.cs b/KfChatDotNetKickBot/KickBot.cs index 4bfe329..9faf461 100644 --- a/KfChatDotNetKickBot/KickBot.cs +++ b/KfChatDotNetKickBot/KickBot.cs @@ -66,7 +66,6 @@ public class KickBot _kickClient.OnStopStreamBroadcast += OnStopStreamBroadcast; _kfClient.StartWsClient().Wait(_cancellationToken); - _kfClient.JoinRoom(_config.KfChatRoomId); _kickClient.StartWsClient().Wait(_cancellationToken); foreach (var channel in _config.PusherChannels) diff --git a/KfChatDotNetWsClient/ChatClient.cs b/KfChatDotNetWsClient/ChatClient.cs index 8e1383f..69d8d33 100644 --- a/KfChatDotNetWsClient/ChatClient.cs +++ b/KfChatDotNetWsClient/ChatClient.cs @@ -103,11 +103,6 @@ public class ChatClient private void WsReconnection(ReconnectionInfo reconnectionInfo) { _logger.Error($"Websocket connection dropped and reconnected. Reconnection type is {reconnectionInfo.Type}"); - if (reconnectionInfo.Type == ReconnectionType.Initial) - { - _logger.Error("Not firing the reconnection event as this is the initial event"); - return; - } OnWsReconnect?.Invoke(this, reconnectionInfo); }