From ca5b1c0733baedbe74acfc87e30416424ed6426b Mon Sep 17 00:00:00 2001 From: Tom Date: Wed, 7 Aug 2024 22:11:09 +0000 Subject: [PATCH] Added up to 3 seconds of wait time for Twitch Id to load in when connecting to Twitch websocket server. --- Twitch/Socket/Handlers/SessionWelcomeHandler.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Twitch/Socket/Handlers/SessionWelcomeHandler.cs b/Twitch/Socket/Handlers/SessionWelcomeHandler.cs index 4882fec..476eda9 100644 --- a/Twitch/Socket/Handlers/SessionWelcomeHandler.cs +++ b/Twitch/Socket/Handlers/SessionWelcomeHandler.cs @@ -31,6 +31,10 @@ namespace TwitchChatTTS.Twitch.Socket.Handlers return; } + int waited = 0; + while (_user.TwitchUserId <= 0 && ++waited < 3) + await Task.Delay(TimeSpan.FromSeconds(1)); + try { await _hermes.AuthorizeTwitch();