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.

This commit is contained in:
barelyprofessional
2024-06-17 19:07:24 +08:00
parent 5cdab275c3
commit f7278c6d3f
2 changed files with 0 additions and 6 deletions

View File

@@ -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)

View File

@@ -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);
}