mirror of
https://github.com/barelyprofessional/KfChatDotNet.git
synced 2026-05-15 02:22:43 -04:00
Big update introducing ghetto command interface, settings, database and howl.gg bet feed scraping
This commit is contained in:
@@ -7,7 +7,7 @@ using Websocket.Client;
|
||||
|
||||
namespace KfChatDotNetKickBot.Services;
|
||||
|
||||
public class TwitchChat : IDisposable
|
||||
public class TwitchChat
|
||||
{
|
||||
private readonly Logger _logger = LogManager.GetCurrentClassLogger();
|
||||
private WebsocketClient _wsClient;
|
||||
@@ -76,8 +76,14 @@ public class TwitchChat : IDisposable
|
||||
private void WsDisconnection(DisconnectionInfo disconnectionInfo)
|
||||
{
|
||||
_logger.Error($"Client disconnected from Discord (or never successfully connected). Type is {disconnectionInfo.Type}");
|
||||
_logger.Error(JsonSerializer.Serialize(disconnectionInfo));
|
||||
_logger.Error($"Close Status => {disconnectionInfo.CloseStatus}; Close Status Description => {disconnectionInfo.CloseStatusDescription}");
|
||||
_logger.Error(disconnectionInfo.Exception);
|
||||
OnWsDisconnection?.Invoke(this, disconnectionInfo);
|
||||
if (disconnectionInfo.Type == DisconnectionType.ByServer)
|
||||
{
|
||||
_logger.Info("Forcing reconnection as the type was ByServer");
|
||||
_wsClient.Reconnect().Wait(_cancellationToken);
|
||||
}
|
||||
}
|
||||
|
||||
private void WsReconnection(ReconnectionInfo reconnectionInfo)
|
||||
@@ -169,11 +175,4 @@ public class TwitchChat : IDisposable
|
||||
_logger.Error("--- End of IRC Message ---");
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
_logger.Info("Disposing Twitch Chat");
|
||||
_wsClient.Dispose();
|
||||
GC.SuppressFinalize(this);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user