From d746d0d073c82f7776aa6eaef46848f5c945a921 Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Mon, 25 Mar 2024 14:15:14 -0400 Subject: [PATCH] custom does not req parent_module validation before say --- src/core/identity.rs | 22 ++-- src/custom/experimental/experiment001.rs | 131 ++++++++++++++++------- src/custom/experimental/experiment002.rs | 35 +++--- 3 files changed, 127 insertions(+), 61 deletions(-) diff --git a/src/core/identity.rs b/src/core/identity.rs index b9223bf..756a50d 100644 --- a/src/core/identity.rs +++ b/src/core/identity.rs @@ -653,16 +653,22 @@ pub async fn init(mgr: Arc) { Some(¶ms.msg), ); - if parent_module.is_some() { + botlock.botmgrs.chat.send_botmsg(super::chat::BotMsgType::Notif( + outmsg.to_string() + ), + params.clone(), + ).await; - botlock.botmgrs.chat.say_in_reply_to( - ¶ms.msg, - outmsg, - // parent_module.unwrap().clone() - params.clone() - ).await; + // if parent_module.is_some() { - } + // botlock.botmgrs.chat.say_in_reply_to( + // ¶ms.msg, + // outmsg, + // // parent_module.unwrap().clone() + // params.clone() + // ).await; + + // } // [ ] NOTE : After the above, I should receive only the roles in the context of the current channel I received this ideally and maybe BotAdmin ; not outside diff --git a/src/custom/experimental/experiment001.rs b/src/custom/experimental/experiment001.rs index be0cb8d..aa9575a 100644 --- a/src/custom/experimental/experiment001.rs +++ b/src/custom/experimental/experiment001.rs @@ -126,7 +126,7 @@ pub async fn init(mgr: Arc) { // }; - let parent_module = params.get_parent_module().await; + // let parent_module = params.get_parent_module().await; // [ ] Uses gen_ratio() to output bool based on a ratio probability . // - For example gen_ratio(2,3) is 2 out of 3 or 0.67% (numerator,denomitator) @@ -153,23 +153,34 @@ pub async fn init(mgr: Arc) { let bot = Arc::clone(¶ms.bot); + let botlock = bot.read().await; + // uses chat.say_in_reply_to() for the bot controls for messages + botlock + .botmgrs + .chat + .say_in_reply_to( + ¶ms.msg, + String::from("GoodGirl xdd "), + // parent_module.unwrap().clone() + params.clone() + ).await; - if parent_module.is_some() { + // if parent_module.is_some() { - // uses chat.say_in_reply_to() for the bot controls for messages - botlock - .botmgrs - .chat - .say_in_reply_to( - ¶ms.msg, - String::from("GoodGirl xdd "), - // parent_module.unwrap().clone() - params.clone() - ).await; + // // uses chat.say_in_reply_to() for the bot controls for messages + // botlock + // .botmgrs + // .chat + // .say_in_reply_to( + // ¶ms.msg, + // String::from("GoodGirl xdd "), + // // parent_module.unwrap().clone() + // params.clone() + // ).await; - } + // } } } @@ -219,46 +230,84 @@ async fn babygirl(params : ExecBodyParams) { let botlock = bot.read().await; - if parent_module.is_some() { - - // uses chat.say_in_reply_to() for the bot controls for messages - botlock - .botmgrs - .chat - .say_in_reply_to( - ¶ms.msg, - String::from("16:13 notohh: cafdk"), - // parent_module.clone().unwrap().clone() - params.clone() - ).await; - sleep(Duration::from_secs_f64(0.5)).await; - - botlock + // uses chat.say_in_reply_to() for the bot controls for messages + botlock .botmgrs .chat .say_in_reply_to( ¶ms.msg, - String::from("16:13 notohh: have fun eating princess"), - // parent_module.clone().unwrap().clone() + String::from("16:13 notohh: cafdk"), params.clone() ).await; - sleep(Duration::from_secs_f64(2.0)).await; + sleep(Duration::from_secs_f64(0.5)).await; - botlock - .botmgrs - .chat - .say_in_reply_to( - ¶ms.msg, - String::from("16:13 notohh: baby girl"), - // parent_module.unwrap().clone() - params.clone() - ).await; + botlock + .botmgrs + .chat + .say_in_reply_to( + ¶ms.msg, + String::from("16:13 notohh: have fun eating princess"), + params.clone() + ).await; - } + + sleep(Duration::from_secs_f64(2.0)).await; + + botlock + .botmgrs + .chat + .say_in_reply_to( + ¶ms.msg, + String::from("16:13 notohh: baby girl"), + params.clone() + ).await; + + + + // if parent_module.is_some() { + + // // uses chat.say_in_reply_to() for the bot controls for messages + // botlock + // .botmgrs + // .chat + // .say_in_reply_to( + // ¶ms.msg, + // String::from("16:13 notohh: cafdk"), + // // parent_module.clone().unwrap().clone() + // params.clone() + // ).await; + + + // sleep(Duration::from_secs_f64(0.5)).await; + + // botlock + // .botmgrs + // .chat + // .say_in_reply_to( + // ¶ms.msg, + // String::from("16:13 notohh: have fun eating princess"), + // // parent_module.clone().unwrap().clone() + // params.clone() + // ).await; + + + // sleep(Duration::from_secs_f64(2.0)).await; + + // botlock + // .botmgrs + // .chat + // .say_in_reply_to( + // ¶ms.msg, + // String::from("16:13 notohh: baby girl"), + // // parent_module.unwrap().clone() + // params.clone() + // ).await; + + // } } diff --git a/src/custom/experimental/experiment002.rs b/src/custom/experimental/experiment002.rs index 96c92c5..fa4a6ce 100644 --- a/src/custom/experimental/experiment002.rs +++ b/src/custom/experimental/experiment002.rs @@ -250,21 +250,32 @@ async fn sayout(params : ExecBodyParams) { let botlock = bot.read().await; + // uses chat.say_in_reply_to() for the bot controls for messages + botlock + .botmgrs + .chat + .say_in_reply_to( + ¶ms.msg, + String::from("Invalid arguments"), + // parent_module.unwrap().clone() + params.clone() + ).await; - if parent_module.is_some() { + + // if parent_module.is_some() { - // uses chat.say_in_reply_to() for the bot controls for messages - botlock - .botmgrs - .chat - .say_in_reply_to( - ¶ms.msg, - String::from("Invalid arguments"), - // parent_module.unwrap().clone() - params.clone() - ).await; + // // uses chat.say_in_reply_to() for the bot controls for messages + // botlock + // .botmgrs + // .chat + // .say_in_reply_to( + // ¶ms.msg, + // String::from("Invalid arguments"), + // // parent_module.unwrap().clone() + // params.clone() + // ).await; - } + // } },