diff --git a/src/core/botinstance.rs b/src/core/botinstance.rs index d453e0b..4472467 100644 --- a/src/core/botinstance.rs +++ b/src/core/botinstance.rs @@ -27,16 +27,6 @@ pub enum ChType { Channel(String), } -// impl PartialEq for ChType { -// fn eq(&self, other:&Self) -> bool { -// let Channel(chnlstr1) = self; -// let Channel(chnlstr2) = other; -// chnlstr1 == chnlstr2 -// } -// } - -// impl Eq for ChType {} - pub use ChType::Channel; @@ -63,7 +53,6 @@ impl BotInstance { pub fn init() -> BotInstance { dotenv().ok(); - // let login_name = "modulatingforcebot".to_owned(); let login_name = env::var("login_name").unwrap().to_owned(); let oauth_token = env::var("access_token").unwrap().to_owned(); let prefix = env::var("prefix").unwrap().to_owned().chars().next().expect("ERROR : when defining prefix"); @@ -72,15 +61,8 @@ impl BotInstance { Vector of channels to join */ - // let chnl = Channel(String::from("modulatingforcebot")); - let mut botchannels = Vec::new(); - // for chnl in env::var("bot_channels").unwrap().split(',') { - // // println!("(Env Var # {})",chnl); - // botchannels.push(String::from(chnl)); - // } - for chnl in env::var("bot_channels").unwrap().split(',') { // println!("(Env Var # {})",chnl); botchannels.push(Channel(String::from(chnl))); @@ -101,6 +83,7 @@ impl BotInstance { client.join(chnl.to_owned()).unwrap(); + // ratelimiters are a hashmap of channel and a corresponding rate limiter let n = RateLimiter::new(); ratelimiters.insert(Channel(String::from(chnl)),n); } @@ -108,10 +91,8 @@ impl BotInstance { let b = BotInstance { - //prefix : '>', prefix : prefix, bot_channel : Channel(login_name) , - // tclient : TwitchClient { incoming_messages , client }, incoming_messages : incoming_messages, client : client, ratelimiters : ratelimiters, // used to limit messages sent per channel @@ -125,14 +106,6 @@ impl BotInstance { // identity : identitymodule, }; - // ratelimiters are a hashmap of channel and a corresponding rate limiter - // let mut ratelimiters:HashMap = HashMap::new(); - - // for chnl in &b.bot_channels { - // let n = RateLimiter::new(); - // // b.ratelimiters.insert(chnl.to_owned(),n); - // b.ratelimiters.insert(chnl,n); - // } println!("{:?}",b.ratelimiters);