From 5ec7210dc6ec78732d2949ce5db88e624310b71b Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Wed, 29 Nov 2023 02:15:11 -0500 Subject: [PATCH] [SMALL] used tuples --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index e6e0b49..9e877ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -69,16 +69,18 @@ pub async fn main() { println!("(#{}) {}: {}", msg.channel_login, msg.sender.name, msg.message_text); if !ratelimittimer { println!("(#{}) > {}", msg.channel_login, "started rate limit timer"); - ratelimitstart = Instant::now(); - ratelimittimer = true; + // ratelimitstart = Instant::now(); + // ratelimittimer = true; + ( ratelimittimer , ratelimitstart ) = ( true , Instant::now() ); } else if ratelimittimer && ratelimitstart.elapsed().as_secs() < 30 && ratelimitcounter >= 20 { // skip iteration if rate limit is being reached println!("(#{}) > {}", msg.channel_login, "rate limit reached"); continue; } else if ratelimitstart.elapsed().as_secs() >= 30 { println!("(#{}) > {}", msg.channel_login, "rate limit timer reset"); - ratelimittimer = false; - ratelimitcounter = 0; + // ratelimittimer = false; + // ratelimitcounter = 0; + ( ratelimittimer , ratelimitcounter ) = ( false , 0 ) ; } let maxblanks = rand::thread_rng().gen_range(1..=5);