Big update introducing ghetto command interface, settings, database and howl.gg bet feed scraping

This commit is contained in:
barelyprofessional
2024-07-18 01:37:15 +10:00
parent 936bf743a5
commit d61a171e54
46 changed files with 2198 additions and 218 deletions
+8 -9
View File
@@ -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);
}
}