diff --git a/src/core/botinstance.rs b/src/core/botinstance.rs index 9453801..60d39c3 100644 --- a/src/core/botinstance.rs +++ b/src/core/botinstance.rs @@ -22,7 +22,9 @@ use crate::core::ratelimiter; // use crate::core::ratelimiter; -struct Channel(String); +enum Ch { + channel(String), +} pub struct BotInstance { @@ -133,7 +135,7 @@ impl BotInstance { match contextratelimiter.check_limiter() { ratelimiter::LimiterResp::Allow => { - let maxblanks = rand::thread_rng().gen_range(1..=5); + let maxblanks = rand::thread_rng().gen_range(1..=20); //let mut outmsg = "GotTrolled ".to_owned(); let mut outmsg = "annytfLurk ".to_owned(); diff --git a/src/helpers.rs b/src/helpers.rs deleted file mode 100644 index 97b5a63..0000000 --- a/src/helpers.rs +++ /dev/null @@ -1,40 +0,0 @@ - -use std::time::Instant; -pub struct RateLimiter { - channels_attr: Vec, -} - - -struct RlAttributes { - channel: String, - enabled: bool, - start_time: Instant, - msg_counter: u32, -} - - - -impl RateLimiter { - pub fn new() -> Self { - Self { - channels_attr: vec![], - } - } - - pub fn sending_msg_to(&mut self, channelname: String) -> bool { - self.channels_attr.push(RlAttributes { - channel: channelname, - enabled: true, - start_time: Instant::now(), - msg_counter: 0, - }); - - let chanRateLimiter = self.channels_attr - .into_iter() - .filter(|r| r.channel == "Hello") - .collect(); - - chanRateLimiter.is_empty() - - } -} \ No newline at end of file