Example #1
0
        async Task TryResurrectWebsocket()
        {
            var driver   = _bot.GetPrivateField("driver");
            var client   = GetClient(driver);
            var oldState = client.State;

            if (IsNeedToReconnect(oldState))
            {
                _logger?.LogWarning($"Websocket state is invalid: {oldState}, try to resurrect it");
                await ResurrectWebsocket(driver);
            }
        }