diff --git a/src/core/botinstance.rs b/src/core/botinstance.rs index c3d1d37..e8b8793 100644 --- a/src/core/botinstance.rs +++ b/src/core/botinstance.rs @@ -181,6 +181,7 @@ impl BotInstance { Some("BotInstance > runner()".to_string()), None, ); + Log::flush(); } ServerMessage::Privmsg(msg) => { @@ -204,6 +205,7 @@ impl BotInstance { Some("BotInstance > runner()".to_string()), Some(&msg), ); + Log::flush(); BotInstance::listener_main_prvmsg(Arc::clone(&bot), &msg).await; } @@ -213,6 +215,7 @@ impl BotInstance { Some("BotInstance > runner()".to_string()), None, ); + Log::flush(); } ServerMessage::Join(msg) => { botlog::notice( @@ -220,6 +223,7 @@ impl BotInstance { Some("BotInstance > runner()".to_string()), None, ); + Log::flush(); } ServerMessage::Part(msg) => { botlog::notice( @@ -227,6 +231,7 @@ impl BotInstance { Some("BotInstance > runner()".to_string()), None, ); + Log::flush(); } _ => {} }; @@ -341,30 +346,6 @@ impl BotInstance { ); - // /* - // [ ] Here, msg is taken, and message_text is split so we can pull the first argument - // */ - - // let inpt = msg - // .message_text - // .split(' ') - // .next() - // .expect("ERROR during BotCommand"); - - // /* - // [ ] What we should do instead is : - // 1. Check if the message is related to a Reply (so we know how many arguments we should skip) - // 2. If a reply, skip the first argument - // */ - - // if let Some(rslt) = msg.source.tags.0.get("reply-thread-parent-msg-id") { - // if let Some(rslt) = rslt { - // println!("Detected Reply : {}",rslt); - // } - // } - - - // [x] Check if a bot command based on ... // [x] prefix + command diff --git a/src/core/chat.rs b/src/core/chat.rs index 6bd61e5..8761516 100644 --- a/src/core/chat.rs +++ b/src/core/chat.rs @@ -174,7 +174,7 @@ impl Chat { pub async fn say(&self, channel_login: String, message: String) { // more info https://docs.rs/twitch-irc/latest/twitch_irc/client/struct.TwitchIRCClient.html#method.say - self.send_botmsg(BotMsgType::Say(channel_login, message)).await; + self.send_botmsg(BotMsgType::Say(channel_login.to_lowercase(), message)).await; } async fn _me(&self, _: String, _: String) { diff --git a/src/custom/experimental/experiment002.rs b/src/custom/experimental/experiment002.rs index fde184e..a00e76b 100644 --- a/src/custom/experimental/experiment002.rs +++ b/src/custom/experimental/experiment002.rs @@ -115,7 +115,16 @@ async fn sayout(bot: BotAR, msg: PrivmsgMessage) { // [x] Validate first if trgchnl exists - if botlock.botmgrs.chat.client.get_channel_status(trgchnl.to_string().clone()).await == (false,false) { + botlog::trace( + &format!("[TRACE] Evaluated status of {} : {:?}", + trgchnl.to_string().clone(),botlock.botmgrs.chat.client.get_channel_status(trgchnl.to_string().clone()).await), + Some("Chat > send_botmsg".to_string()), + None, + ); + + // if botlock.botmgrs.chat.client.get_channel_status(trgchnl.to_string().clone()).await == (false,false) { + if !botlock.bot_channels.contains(&Channel(trgchnl.to_lowercase().to_string().clone())) { + // in the case where the provided channel isn't something we're known to be connected to botlog::warn( &format!("A message attempted to send for a Non-Joined Channel : {}",trgchnl.to_string().clone()),