refactor core to use Notif msg

This commit is contained in:
ModulatingForce 2024-03-25 14:11:21 -04:00
commit 628db3c229
4 changed files with 184 additions and 102 deletions

View file

@ -410,38 +410,57 @@ impl BotInstance {
// Only respond to those with th ebelow User Roles
if user_roles.contains(&identity::UserRole::Mod(Channel(msg.channel_login.clone())))
|| user_roles.contains(&identity::UserRole::SupMod(Channel(msg.channel_login.clone())))
|| user_roles.contains(&identity::UserRole::Broadcaster)
|| user_roles.contains(&identity::UserRole::BotAdmin)
{
let outstr =
format!("sadg Module is disabled : {:?}",a);
let params = ExecBodyParams {
bot : Arc::clone(&bot),
msg : (*msg).clone(),
parent_act : Arc::clone(&act_clone),
};
// When sending a BotMsgTypeNotif, send_botmsg does Roles related validation as required
botlock.botmgrs.chat.send_botmsg(super::chat::BotMsgType::Notif(
outstr
),
params,
).await;
// if user_roles.contains(&identity::UserRole::Mod(Channel(msg.channel_login.clone())))
// || user_roles.contains(&identity::UserRole::SupMod(Channel(msg.channel_login.clone())))
// || user_roles.contains(&identity::UserRole::Broadcaster)
// || user_roles.contains(&identity::UserRole::BotAdmin)
// {
// self.say_in_reply_to(
// &params.msg,
// format!("uuh You do not have the right roles to send to {}",
// channel_login.clone(),
// ),
// params.clone()
// ).await;
let outstr =
format!("sadg Module is disabled : {:?}",a);
// // self.say_in_reply_to(
// // &params.msg,
// // format!("uuh You do not have the right roles to send to {}",
// // channel_login.clone(),
// // ),
// // params.clone()
// // ).await;
// let outstr =
// format!("sadg Module is disabled : {:?}",a);
let params = ExecBodyParams {
bot : Arc::clone(&bot),
msg : (*msg).clone(),
parent_act : Arc::clone(&act_clone),
};
// let params = ExecBodyParams {
// bot : Arc::clone(&bot),
// msg : (*msg).clone(),
// parent_act : Arc::clone(&act_clone),
// };
botlock.botmgrs.chat.say_in_reply_to(
msg,
outstr,
// c.module.clone()
params,
).await;
// botlock.botmgrs.chat.say_in_reply_to(
// msg,
// outstr,
// // c.module.clone()
// params,
// ).await;
}
// }
// botlog::trace(