mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-02 04:22:04 -04:00
Fix missing update cookie + force reconnect when bot is already logged in
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user