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()
botlock.botmgrs.chat.say_in_reply_to( ),
&params.msg, params.clone(),
outmsg,
// parent_module.unwrap().clone()
params.clone()
).await; ).await;
} // if parent_module.is_some() {
// 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,11 +153,9 @@ 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;
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
@ -169,7 +167,20 @@ pub async fn init(mgr: Arc<ModulesManager>) {
params.clone() params.clone()
).await; ).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("GoodGirl xdd "),
// // parent_module.unwrap().clone()
// params.clone()
// ).await;
// }
} }
} }
@ -219,7 +230,7 @@ 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 // uses chat.say_in_reply_to() for the bot controls for messages
botlock botlock
@ -228,7 +239,6 @@ async fn babygirl(params : ExecBodyParams) {
.say_in_reply_to( .say_in_reply_to(
&params.msg, &params.msg,
String::from("16:13 notohh: cafdk"), String::from("16:13 notohh: cafdk"),
// parent_module.clone().unwrap().clone()
params.clone() params.clone()
).await; ).await;
@ -241,7 +251,6 @@ async fn babygirl(params : ExecBodyParams) {
.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: have fun eating princess"),
// parent_module.clone().unwrap().clone()
params.clone() params.clone()
).await; ).await;
@ -254,11 +263,51 @@ async fn babygirl(params : ExecBodyParams) {
.say_in_reply_to( .say_in_reply_to(
&params.msg, &params.msg,
String::from("16:13 notohh: baby girl"), String::from("16:13 notohh: baby girl"),
// parent_module.unwrap().clone()
params.clone() params.clone()
).await; ).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,9 +250,6 @@ async fn sayout(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 // uses chat.say_in_reply_to() for the bot controls for messages
botlock botlock
.botmgrs .botmgrs
@ -264,7 +261,21 @@ async fn sayout(params : ExecBodyParams) {
params.clone() params.clone()
).await; ).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("Invalid arguments"),
// // parent_module.unwrap().clone()
// params.clone()
// ).await;
// }
}, },