Fix missing update cookie + force reconnect when bot is already logged in

This commit is contained in:
barelyprofessional
2026-02-10 08:39:25 -06:00
parent 21c8803eb9
commit 26d1da3069

View File

@@ -230,6 +230,13 @@ public class ChatBot
if (await _kfTokenService.IsLoggedIn())
{
_logger.Info("We were already logged in and should have a fresh cookie for chat now");
if (autoConnect && !KfClient.IsConnected())
{
_logger.Info("Updating cookies and reconnecting");
await _kfTokenService.SaveCookies();
KfClient.UpdateCookies(_kfTokenService.GetCookies());
await KfClient.StartWsClient();
}
// Only seems to happen if the bot thinks it's already logged in
return;
}