custom does not req parent_module validation before say
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful

This commit is contained in:
ModulatingForce 2024-03-25 14:15:14 -04:00
parent 628db3c229
commit d746d0d073
3 changed files with 127 additions and 61 deletions

View file

@ -653,16 +653,22 @@ pub async fn init(mgr: Arc<ModulesManager>) {
Some(&params.msg), Some(&params.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( // if parent_module.is_some() {
&params.msg,
outmsg,
// parent_module.unwrap().clone()
params.clone()
).await;
} // botlock.botmgrs.chat.say_in_reply_to(
// &params.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 // [ ] 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

View file

@ -126,7 +126,7 @@ pub async fn init(mgr: Arc<ModulesManager>) {
// }; // };
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 . // [ ] 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) // - 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<ModulesManager>) {
let bot = Arc::clone(&params.bot); let bot = Arc::clone(&params.bot);
let botlock = bot.read().await; let botlock = bot.read().await;
// uses chat.say_in_reply_to() for the bot controls for messages
botlock
.botmgrs
.chat
.say_in_reply_to(
&params.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 // // uses chat.say_in_reply_to() for the bot controls for messages
botlock // botlock
.botmgrs // .botmgrs
.chat // .chat
.say_in_reply_to( // .say_in_reply_to(
&params.msg, // &params.msg,
String::from("GoodGirl xdd "), // String::from("GoodGirl xdd "),
// parent_module.unwrap().clone() // // parent_module.unwrap().clone()
params.clone() // params.clone()
).await; // ).await;
} // }
} }
} }
@ -219,46 +230,84 @@ async fn babygirl(params : ExecBodyParams) {
let botlock = bot.read().await; 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(
&params.msg,
String::from("16:13 notohh: cafdk"),
// parent_module.clone().unwrap().clone()
params.clone()
).await;
sleep(Duration::from_secs_f64(0.5)).await; // uses chat.say_in_reply_to() for the bot controls for messages
botlock
botlock
.botmgrs .botmgrs
.chat .chat
.say_in_reply_to( .say_in_reply_to(
&params.msg, &params.msg,
String::from("16:13 notohh: have fun eating princess"), String::from("16:13 notohh: cafdk"),
// parent_module.clone().unwrap().clone()
params.clone() params.clone()
).await; ).await;
sleep(Duration::from_secs_f64(2.0)).await; sleep(Duration::from_secs_f64(0.5)).await;
botlock botlock
.botmgrs .botmgrs
.chat .chat
.say_in_reply_to( .say_in_reply_to(
&params.msg, &params.msg,
String::from("16:13 notohh: baby girl"), String::from("16:13 notohh: have fun eating princess"),
// parent_module.unwrap().clone() params.clone()
params.clone() ).await;
).await;
}
sleep(Duration::from_secs_f64(2.0)).await;
botlock
.botmgrs
.chat
.say_in_reply_to(
&params.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(
// &params.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(
// &params.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(
// &params.msg,
// String::from("16:13 notohh: baby girl"),
// // parent_module.unwrap().clone()
// params.clone()
// ).await;
// }
} }

View file

@ -250,21 +250,32 @@ async fn sayout(params : ExecBodyParams) {
let botlock = bot.read().await; let botlock = bot.read().await;
// uses chat.say_in_reply_to() for the bot controls for messages
botlock
.botmgrs
.chat
.say_in_reply_to(
&params.msg,
String::from("Invalid arguments"),
// parent_module.unwrap().clone()
params.clone()
).await;
if parent_module.is_some() {
// uses chat.say_in_reply_to() for the bot controls for messages // if parent_module.is_some() {
botlock
.botmgrs
.chat
.say_in_reply_to(
&params.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(
// &params.msg,
// String::from("Invalid arguments"),
// // parent_module.unwrap().clone()
// params.clone()
// ).await;
// }
}, },