This commit is contained in:
ModulatingForce 2023-12-19 19:30:08 -05:00
parent b1c2c2b099
commit 142b620720
2 changed files with 4 additions and 2 deletions

View file

@ -56,7 +56,7 @@ pub async fn main() {
for chnl in &botchannels { for chnl in &botchannels {
client.join(chnl.to_owned()).unwrap(); client.join(chnl.to_owned()).unwrap();
// client.say(chnl.to_owned(), "Connected!".to_owned()).await.unwrap(); // client.say(chnl.to_owned(), "Connected!".to_owned()).await.unwrap();
client.say(chnl.to_owned(), "annytfLurk".to_owned()).await.unwrap(); //client.say(chnl.to_owned(), "annytfLurk".to_owned()).await.unwrap();
} }
// Adding rate limit functionality to be under : https://dev.twitch.tv/docs/irc/#rate-limits // Adding rate limit functionality to be under : https://dev.twitch.tv/docs/irc/#rate-limits
@ -92,7 +92,8 @@ pub async fn main() {
match contextratelimiter.check_limiter() { match contextratelimiter.check_limiter() {
ratelimiter::LimiterResp::Allow => { ratelimiter::LimiterResp::Allow => {
let maxblanks = rand::thread_rng().gen_range(1..=5); let maxblanks = rand::thread_rng().gen_range(1..=5);
let mut outmsg = "GotTrolled ".to_owned(); //let mut outmsg = "GotTrolled ".to_owned();
let mut outmsg = "annytfLurk ".to_owned();
for _i in 1..maxblanks { for _i in 1..maxblanks {
let blankspace: &str = "󠀀"; let blankspace: &str = "󠀀";

View file

@ -4,6 +4,7 @@ use std::time::Instant;
const TIME_THRESHOLD_S: u64 = 30; const TIME_THRESHOLD_S: u64 = 30;
const MSG_THRESHOLD: u32 = 20; const MSG_THRESHOLD: u32 = 20;
#[derive(Debug)] #[derive(Debug)]
pub struct RateLimiter { pub struct RateLimiter {
timer: Instant, timer: Instant,