comments cleanup
This commit is contained in:
parent
0df3a0e648
commit
f0028f6751
1 changed files with 1 additions and 28 deletions
|
@ -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<String,RateLimiter> = 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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue