From 8ced3278af5cd212355e4898ba2d7d4d22ab8833 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Tue, 11 Oct 2022 14:53:00 +0200 Subject: [PATCH] add env variable for api time factor, set default to 3 --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ff7e9ed..078d769 100644 --- a/src/main.rs +++ b/src/main.rs @@ -206,7 +206,7 @@ async fn send_frames(message: Message, ctx: Context) { handle.set_volume(1.0).unwrap(); println!("voice: waiting for video [api_time={api_time}]"); tokio::time::sleep(Duration::from_millis( - 5000 - (unix_millis() - sa) + (api_time * 2), + 5000 - (unix_millis() - sa) + (api_time * u64::from_str_radix(env::var("PROJBOTV3_API_TIME_FACTOR").unwrap_or("3".into()).as_str(), 10).unwrap()), )) .await; println!("voice: playing");