Added a feature to reconnect if the bot somehow gets stuck (either not joined to a channel or stuck in a disconnected state)

This commit is contained in:
barelyprofessional
2024-06-27 11:30:41 +08:00
parent 4ece07d64d
commit 2e4616c736
2 changed files with 16 additions and 0 deletions

View File

@@ -51,6 +51,11 @@ public class ChatClient
_wsClient.Stop(WebSocketCloseStatus.NormalClosure, "Closing websocket").Wait();
}
public async Task Reconnect()
{
await _wsClient.Reconnect();
}
private async Task CreateWsClient()
{
var factory = new Func<ClientWebSocket>(() =>