Chat say functionality #41

Merged
modulatingforce merged 14 commits from chat-say into main 2024-03-24 00:00:48 -04:00
3 changed files with 16 additions and 26 deletions
Showing only changes of commit 098f16ce87 - Show all commits

View file

@ -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

View file

@ -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) {

View file

@ -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()),