From f8d93a2295e7f9f9011641caa71f1df78cd9a77d Mon Sep 17 00:00:00 2001 From: Bulat Kurbanov Date: Wed, 7 Aug 2024 19:41:31 +0200 Subject: [PATCH] Fix --- src/twitch_handler/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/twitch_handler/mod.rs b/src/twitch_handler/mod.rs index be0c22a..d1cbdc1 100644 --- a/src/twitch_handler/mod.rs +++ b/src/twitch_handler/mod.rs @@ -74,12 +74,16 @@ impl TwitchBot { }; let token = token_storage.load().await.unwrap(); - let mut client = helix::Client::from_token( + let mut client = match helix::Client::from_token( config::CONFIG.twitch_client_id.clone(), config::CONFIG.twitch_client_secret.clone(), token_storage, token - ).await.or_else(panic("Failed to create Twitch client")); + ).await { + Ok(v) => v, + Err(err) => panic!("{:?}", err), + }; + let mut current_state: Option = { let stream = client.get_stream(config::CONFIG.twitch_channel_id.clone()).await;