pub struct changes
look into error at identity:1333
This commit is contained in:
parent
960cd5724c
commit
bed61c2830
6 changed files with 61 additions and 48 deletions
|
@ -1,4 +1,4 @@
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
# Based on https://doc.rust-lang.org/cargo/reference/config.html
|
# Based on https://doc.rust-lang.org/cargo/reference/config.html
|
||||||
OtherBots = "Supibot,buttsbot,PotatBotat,StreamElements"
|
OtherBots = "Supibot,buttsbot,PotatBotat,StreamElements,yuumeibot"
|
||||||
|
|
|
@ -43,8 +43,14 @@ pub enum ChangeResult {
|
||||||
// pub use ChType::Channel;
|
// pub use ChType::Channel;
|
||||||
//
|
//
|
||||||
//simplifying from enum to struct
|
//simplifying from enum to struct
|
||||||
pub struct Channel(pub String);
|
pub struct Channel(String);
|
||||||
|
impl Channel
|
||||||
|
{
|
||||||
|
pub fn construct(channel_string:String) -> Channel
|
||||||
|
{
|
||||||
|
Channel(channel_string)
|
||||||
|
}
|
||||||
|
}
|
||||||
use super::botmodules::StatusType;
|
use super::botmodules::StatusType;
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
@ -415,8 +415,15 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
// BotModule(String),
|
// BotModule(String),
|
||||||
// }
|
// }
|
||||||
|
|
||||||
pub struct BotModule(pub String);
|
pub struct BotModule(String);
|
||||||
//botmodule simplified from enum to tuple struct
|
//botmodule simplified from enum to tuple struct
|
||||||
|
impl BotModule{
|
||||||
|
pub fn construct(module_name:String) -> BotModule
|
||||||
|
{
|
||||||
|
BotModule(module_name)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
impl PartialEq for BotModule {
|
impl PartialEq for BotModule {
|
||||||
fn eq(&self, other: &Self) -> bool {
|
fn eq(&self, other: &Self) -> bool {
|
||||||
|
|
|
@ -58,7 +58,7 @@ impl Chat {
|
||||||
|
|
||||||
let contextratelimiter = rllock
|
let contextratelimiter = rllock
|
||||||
// .get_mut()
|
// .get_mut()
|
||||||
.get_mut(&Channel(String::from(&msg.channel_login)))
|
.get_mut(&Channel::construct(String::from(&msg.channel_login)))
|
||||||
.expect("ERROR: Issue with Rate limiters");
|
.expect("ERROR: Issue with Rate limiters");
|
||||||
|
|
||||||
// Continue to check the limiter and sleep if required if the minimum is not reached
|
// Continue to check the limiter and sleep if required if the minimum is not reached
|
||||||
|
|
|
@ -54,14 +54,14 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
);
|
);
|
||||||
|
|
||||||
let tempb = BotCommand {
|
let tempb = BotCommand {
|
||||||
module: BotModule(String::from("identity")),
|
module: BotModule::construct(String::from("identity")),
|
||||||
command: String::from("promote"), // command call name
|
command: String::from("promote"), // command call name
|
||||||
alias: vec![], // String of alternative names
|
alias: vec![], // String of alternative names
|
||||||
exec_body: actions_util::asyncbox(cmd_promote),
|
exec_body: actions_util::asyncbox(cmd_promote),
|
||||||
help: String::from("promote"),
|
help: String::from("promote"),
|
||||||
required_roles: vec![
|
required_roles: vec![
|
||||||
UserRole::Mod(Channel(String::new())),
|
UserRole::Mod(Channel::construct(String::new())),
|
||||||
UserRole::SupMod(Channel(String::new())),
|
UserRole::SupMod(Channel::construct(String::new())),
|
||||||
UserRole::Broadcaster,
|
UserRole::Broadcaster,
|
||||||
UserRole::BotAdmin,
|
UserRole::BotAdmin,
|
||||||
],
|
],
|
||||||
|
@ -172,7 +172,7 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
sendername.clone(),
|
sendername.clone(),
|
||||||
&sender_badge,
|
&sender_badge,
|
||||||
targetusr.to_string(),
|
targetusr.to_string(),
|
||||||
Some(Channel(targetchnl.clone())),
|
Some(Channel::construct(targetchnl.clone())),
|
||||||
target_bot_admin_role,
|
target_bot_admin_role,
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
|
@ -226,14 +226,14 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempb = BotCommand {
|
let tempb = BotCommand {
|
||||||
module: BotModule(String::from("identity")),
|
module: BotModule::construct(String::from("identity")),
|
||||||
command: String::from("demote"), // command call name
|
command: String::from("demote"), // command call name
|
||||||
alias: vec![], // String of alternative names
|
alias: vec![], // String of alternative names
|
||||||
exec_body: actions_util::asyncbox(cmd_demote),
|
exec_body: actions_util::asyncbox(cmd_demote),
|
||||||
help: String::from("demote"),
|
help: String::from("demote"),
|
||||||
required_roles: vec![
|
required_roles: vec![
|
||||||
UserRole::Mod(Channel(String::new())),
|
UserRole::Mod(Channel::construct(String::new())),
|
||||||
UserRole::SupMod(Channel(String::new())),
|
UserRole::SupMod(Channel::construct(String::new())),
|
||||||
UserRole::Broadcaster,
|
UserRole::Broadcaster,
|
||||||
UserRole::BotAdmin,
|
UserRole::BotAdmin,
|
||||||
],
|
],
|
||||||
|
@ -368,7 +368,7 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
sendername.clone(),
|
sendername.clone(),
|
||||||
&sender_badge,
|
&sender_badge,
|
||||||
targetusr.to_string(),
|
targetusr.to_string(),
|
||||||
Some(Channel(targetchnl.clone())),
|
Some(Channel::construct(targetchnl.clone())),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -418,14 +418,14 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
let tempcomm = BotCommand {
|
let tempcomm = BotCommand {
|
||||||
module: BotModule(String::from("identity")),
|
module: BotModule::construct(String::from("identity")),
|
||||||
command: String::from("getroles"), // command call name
|
command: String::from("getroles"), // command call name
|
||||||
alias: vec![], // String of alternative names
|
alias: vec![], // String of alternative names
|
||||||
exec_body: actions_util::asyncbox(getroles),
|
exec_body: actions_util::asyncbox(getroles),
|
||||||
help: String::from("getroles"),
|
help: String::from("getroles"),
|
||||||
required_roles: vec![
|
required_roles: vec![
|
||||||
UserRole::Mod(Channel(String::new())),
|
UserRole::Mod(Channel::construct(String::new())),
|
||||||
UserRole::SupMod(Channel(String::new())),
|
UserRole::SupMod(Channel::construct(String::new())),
|
||||||
UserRole::Broadcaster,
|
UserRole::Broadcaster,
|
||||||
UserRole::BotAdmin,
|
UserRole::BotAdmin,
|
||||||
],
|
],
|
||||||
|
@ -477,7 +477,7 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
idlock
|
idlock
|
||||||
.getspecialuserroles(
|
.getspecialuserroles(
|
||||||
String::from(targetuser),
|
String::from(targetuser),
|
||||||
Some(Channel(msg.channel_login.to_lowercase())),
|
Some(Channel::construct(msg.channel_login.to_lowercase())),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -486,20 +486,20 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
let callersproles = idlock
|
let callersproles = idlock
|
||||||
.getspecialuserroles(
|
.getspecialuserroles(
|
||||||
msg.sender.name.to_lowercase(),
|
msg.sender.name.to_lowercase(),
|
||||||
Some(Channel(targetchnl.to_lowercase().to_string())),
|
Some(Channel::construct(targetchnl.to_lowercase().to_string())),
|
||||||
)
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
if callersproles.contains(&UserRole::Mod(Channel(
|
if callersproles.contains(&UserRole::Mod(Channel::construct(
|
||||||
targetchnl.to_lowercase().to_string(),
|
targetchnl.to_lowercase().to_string(),
|
||||||
))) || callersproles.contains(&UserRole::SupMod(Channel(
|
))) || callersproles.contains(&UserRole::SupMod(Channel::construct(
|
||||||
targetchnl.to_lowercase().to_string(),
|
targetchnl.to_lowercase().to_string(),
|
||||||
))) || callersproles.contains(&UserRole::Broadcaster)
|
))) || callersproles.contains(&UserRole::Broadcaster)
|
||||||
{
|
{
|
||||||
idlock
|
idlock
|
||||||
.getspecialuserroles(
|
.getspecialuserroles(
|
||||||
String::from(targetuser),
|
String::from(targetuser),
|
||||||
Some(Channel(targetchnl.to_lowercase())),
|
Some(Channel::construct(targetchnl.to_lowercase())),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
} else {
|
} else {
|
||||||
|
@ -507,7 +507,7 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
idlock
|
idlock
|
||||||
.getspecialuserroles(
|
.getspecialuserroles(
|
||||||
String::from(targetuser),
|
String::from(targetuser),
|
||||||
Some(Channel(msg.channel_login.to_lowercase())),
|
Some(Channel::construct(msg.channel_login.to_lowercase())),
|
||||||
)
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
@ -535,18 +535,18 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
|
|
||||||
let mut outmsg = "FeelsWowMan they're the broadcaster. ".to_string();
|
let mut outmsg = "FeelsWowMan they're the broadcaster. ".to_string();
|
||||||
|
|
||||||
if sproles.contains(&UserRole::Mod(Channel(
|
if sproles.contains(&UserRole::Mod(Channel::construct(
|
||||||
msg.channel_login.to_lowercase(),
|
msg.channel_login.to_lowercase(),
|
||||||
))) || sproles.contains(&UserRole::SupMod(Channel(
|
))) || sproles.contains(&UserRole::SupMod(Channel::construct(
|
||||||
msg.channel_login.to_lowercase(),
|
msg.channel_login.to_lowercase(),
|
||||||
))) || sproles.contains(&UserRole::BotAdmin)
|
))) || sproles.contains(&UserRole::BotAdmin)
|
||||||
{
|
{
|
||||||
outmsg += format!("Target chatter's user roles are : {:?}", sproles).as_str();
|
outmsg += format!("Target chatter's user roles are : {:?}", sproles).as_str();
|
||||||
}
|
}
|
||||||
outmsg
|
outmsg
|
||||||
} else if sproles.contains(&UserRole::Mod(Channel(
|
} else if sproles.contains(&UserRole::Mod(Channel::construct(
|
||||||
msg.channel_login.to_lowercase(),
|
msg.channel_login.to_lowercase(),
|
||||||
))) || sproles.contains(&UserRole::SupMod(Channel(
|
))) || sproles.contains(&UserRole::SupMod(Channel::construct(
|
||||||
msg.channel_login.to_lowercase(),
|
msg.channel_login.to_lowercase(),
|
||||||
))) || sproles.contains(&UserRole::BotAdmin)
|
))) || sproles.contains(&UserRole::BotAdmin)
|
||||||
{
|
{
|
||||||
|
@ -698,7 +698,7 @@ impl IdentityManager {
|
||||||
|
|
||||||
self.can_user_run(
|
self.can_user_run(
|
||||||
msg.sender.name.to_owned(),
|
msg.sender.name.to_owned(),
|
||||||
Channel(msg.channel_login.to_owned()),
|
Channel::construct(msg.channel_login.to_owned()),
|
||||||
sender_badge,
|
sender_badge,
|
||||||
cmdreqroles,
|
cmdreqroles,
|
||||||
)
|
)
|
||||||
|
@ -799,8 +799,8 @@ impl IdentityManager {
|
||||||
// [x] and cmdreqroles includes UserRole::Mod("") OR UserRole::SupMod("") , Ok(Permissible::Allow)
|
// [x] and cmdreqroles includes UserRole::Mod("") OR UserRole::SupMod("") , Ok(Permissible::Allow)
|
||||||
Some(ChatBadge::Broadcaster) => {
|
Some(ChatBadge::Broadcaster) => {
|
||||||
if cmdreqroles.contains(&UserRole::Broadcaster)
|
if cmdreqroles.contains(&UserRole::Broadcaster)
|
||||||
|| cmdreqroles.contains(&UserRole::Mod(Channel(String::new())))
|
|| cmdreqroles.contains(&UserRole::Mod(Channel::construct(String::new())))
|
||||||
|| cmdreqroles.contains(&UserRole::SupMod(Channel(String::new())))
|
|| cmdreqroles.contains(&UserRole::SupMod(Channel::construct(String::new())))
|
||||||
{
|
{
|
||||||
// return Ok(Permissible::Allow)
|
// return Ok(Permissible::Allow)
|
||||||
return (
|
return (
|
||||||
|
@ -869,7 +869,7 @@ impl IdentityManager {
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
|
|
||||||
if cmdreqroles.contains(&UserRole::Mod(Channel(String::new()))) {
|
if cmdreqroles.contains(&UserRole::Mod(Channel::construct(String::new()))) {
|
||||||
botlog::trace(
|
botlog::trace(
|
||||||
"Command requires Mod Role",
|
"Command requires Mod Role",
|
||||||
Some("identity.rs > can_user_run()".to_string()),
|
Some("identity.rs > can_user_run()".to_string()),
|
||||||
|
@ -905,7 +905,7 @@ impl IdentityManager {
|
||||||
|
|
||||||
// [x] If cmdreqroles includes UserRole::SupMod("") , checks if chatter has UserRole::SupMod(channelname::ChType) to determine if Ok(Permissible::Allow)
|
// [x] If cmdreqroles includes UserRole::SupMod("") , checks if chatter has UserRole::SupMod(channelname::ChType) to determine if Ok(Permissible::Allow)
|
||||||
|
|
||||||
if cmdreqroles.contains(&UserRole::SupMod(Channel(String::new()))) {
|
if cmdreqroles.contains(&UserRole::SupMod(Channel::construct(String::new()))) {
|
||||||
if let Some(a) = self
|
if let Some(a) = self
|
||||||
.special_roles_users
|
.special_roles_users
|
||||||
.read()
|
.read()
|
||||||
|
@ -1292,7 +1292,7 @@ impl IdentityManager {
|
||||||
evalsproles.push(UserRole::Broadcaster);
|
evalsproles.push(UserRole::Broadcaster);
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(Channel(channel_tmp))
|
Some(Channel::construct(channel_tmp))
|
||||||
} // _ => ()
|
} // _ => ()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1379,8 +1379,8 @@ mod core_identity {
|
||||||
fn user_role_identity() {
|
fn user_role_identity() {
|
||||||
Log::set_file_ext(Extension::Log);
|
Log::set_file_ext(Extension::Log);
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
UserRole::SupMod(Channel("strong".to_string())),
|
UserRole::SupMod(Channel::construct("strong".to_string())),
|
||||||
UserRole::SupMod(Channel("Strong".to_lowercase()))
|
UserRole::SupMod(Channel::construct("Strong".to_lowercase()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1395,7 +1395,7 @@ mod core_identity {
|
||||||
|
|
||||||
let (usr, channelname, chat_badge, cmdreqroles) = (
|
let (usr, channelname, chat_badge, cmdreqroles) = (
|
||||||
bot,
|
bot,
|
||||||
Channel("twitchchanneltest".to_string()),
|
Channel::construct("twitchchanneltest".to_string()),
|
||||||
None,
|
None,
|
||||||
vec![]
|
vec![]
|
||||||
);
|
);
|
||||||
|
@ -1420,7 +1420,7 @@ mod core_identity {
|
||||||
let test_id_mgr = IdentityManager::init();
|
let test_id_mgr = IdentityManager::init();
|
||||||
|
|
||||||
// [x] Mod Attempts to Promote User
|
// [x] Mod Attempts to Promote User
|
||||||
let channel = Some(Channel("twitchchanneltest".to_string()));
|
let channel = Some(Channel::construct("twitchchanneltest".to_string()));
|
||||||
let trgchatter = "regularChatter".to_string();
|
let trgchatter = "regularChatter".to_string();
|
||||||
let authorizer_badge = &Some(ChatBadge::Mod);
|
let authorizer_badge = &Some(ChatBadge::Mod);
|
||||||
let authorizer = "chatMod".to_string();
|
let authorizer = "chatMod".to_string();
|
||||||
|
@ -1450,7 +1450,7 @@ mod core_identity {
|
||||||
let test_id_mgr = IdentityManager::init();
|
let test_id_mgr = IdentityManager::init();
|
||||||
|
|
||||||
// [x] Broadcaster Promotes Chatter to SupMod
|
// [x] Broadcaster Promotes Chatter to SupMod
|
||||||
let channel = Some(Channel("broadcasterer".to_string()));
|
let channel = Some(Channel::construct("broadcasterer".to_string()));
|
||||||
let trgchatter = "regularChatter".to_string();
|
let trgchatter = "regularChatter".to_string();
|
||||||
let authorizer_badge = &Some(ChatBadge::Broadcaster);
|
let authorizer_badge = &Some(ChatBadge::Broadcaster);
|
||||||
let authorizer = "broadcasterer".to_string();
|
let authorizer = "broadcasterer".to_string();
|
||||||
|
@ -1475,7 +1475,7 @@ mod core_identity {
|
||||||
.getspecialuserroles(trgchatter.clone(), channel.clone())
|
.getspecialuserroles(trgchatter.clone(), channel.clone())
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(rslt.contains(&UserRole::Mod(Channel("broadcasterer".to_string()))));
|
assert!(rslt.contains(&UserRole::Mod(Channel::construct("broadcasterer".to_string()))));
|
||||||
|
|
||||||
let rslt = test_id_mgr
|
let rslt = test_id_mgr
|
||||||
.promote(
|
.promote(
|
||||||
|
@ -1496,7 +1496,7 @@ mod core_identity {
|
||||||
.getspecialuserroles(trgchatter.clone(), channel.clone())
|
.getspecialuserroles(trgchatter.clone(), channel.clone())
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
assert!(rslt.contains(&UserRole::SupMod(Channel(
|
assert!(rslt.contains(&UserRole::SupMod(Channel::construct(
|
||||||
"broadcasterer".to_string()
|
"broadcasterer".to_string()
|
||||||
))));
|
))));
|
||||||
|
|
||||||
|
@ -1530,7 +1530,7 @@ mod core_identity {
|
||||||
let broadcaster = "broadcasterer".to_string();
|
let broadcaster = "broadcasterer".to_string();
|
||||||
let broadcaster_badge = &Some(ChatBadge::Broadcaster);
|
let broadcaster_badge = &Some(ChatBadge::Broadcaster);
|
||||||
// let channel = Some(ChType::Channel(broadcaster.clone()));
|
// let channel = Some(ChType::Channel(broadcaster.clone()));
|
||||||
let channel = Channel(broadcaster.clone());
|
let channel = Channel::construct(broadcaster.clone());
|
||||||
let supchatter = "superModerator".to_string();
|
let supchatter = "superModerator".to_string();
|
||||||
let trg_role = None;
|
let trg_role = None;
|
||||||
|
|
||||||
|
@ -1575,7 +1575,7 @@ mod core_identity {
|
||||||
// let broadcaster = "broadcasterer".to_string();
|
// let broadcaster = "broadcasterer".to_string();
|
||||||
let authorizer = supchatter;
|
let authorizer = supchatter;
|
||||||
let authorizer_badge = &Some(ChatBadge::Broadcaster);
|
let authorizer_badge = &Some(ChatBadge::Broadcaster);
|
||||||
let channel = Some(Channel(broadcaster.clone()));
|
let channel = Some(Channel::construct(broadcaster.clone()));
|
||||||
let trgchatter = "regularChatter".to_string();
|
let trgchatter = "regularChatter".to_string();
|
||||||
let trg_role = None;
|
let trg_role = None;
|
||||||
|
|
||||||
|
@ -1646,7 +1646,7 @@ mod core_identity {
|
||||||
// let broadcaster = "broadcasterer".to_string();
|
// let broadcaster = "broadcasterer".to_string();
|
||||||
let authorizer = botadmin;
|
let authorizer = botadmin;
|
||||||
let authorizer_badge = botadmin_badge;
|
let authorizer_badge = botadmin_badge;
|
||||||
let channel = Some(Channel("somechannel".to_string()));
|
let channel = Some(Channel::construct("somechannel".to_string()));
|
||||||
let trgchatter = "regularChatter".to_string();
|
let trgchatter = "regularChatter".to_string();
|
||||||
let trg_role = None;
|
let trg_role = None;
|
||||||
|
|
||||||
|
@ -1721,7 +1721,7 @@ mod core_identity {
|
||||||
|
|
||||||
let supmod = "supmoder".to_string();
|
let supmod = "supmoder".to_string();
|
||||||
|
|
||||||
let channel = Some(Channel("somechannel".to_string()));
|
let channel = Some(Channel::construct("somechannel".to_string()));
|
||||||
|
|
||||||
test_id_mgr.affirm_chatter_in_db(supmod.clone()).await;
|
test_id_mgr.affirm_chatter_in_db(supmod.clone()).await;
|
||||||
test_id_mgr
|
test_id_mgr
|
||||||
|
|
|
@ -28,11 +28,11 @@ use tokio::time::{sleep, Duration};
|
||||||
|
|
||||||
pub async fn init(mgr: Arc<ModulesManager>) {
|
pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
|
|
||||||
const OF_CMD_CHANNEL:Channel = Channel(String::new());
|
const OF_CMD_CHANNEL:Channel = Channel::construct(String::new());
|
||||||
|
|
||||||
// 1. Define the BotAction
|
// 1. Define the BotAction
|
||||||
let botc1 = BotCommand {
|
let botc1 = BotCommand {
|
||||||
module: BotModule(String::from("experiments001")),
|
module: BotModule::construct(String::from("experiments001")),
|
||||||
command: String::from("test1"), // command call name
|
command: String::from("test1"), // command call name
|
||||||
alias: vec![
|
alias: vec![
|
||||||
String::from("tester1"),
|
String::from("tester1"),
|
||||||
|
@ -50,7 +50,7 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
|
|
||||||
// 1. Define the BotAction
|
// 1. Define the BotAction
|
||||||
let list1 = Listener {
|
let list1 = Listener {
|
||||||
module: BotModule(String::from("experiments001")),
|
module: BotModule::construct(String::from("experiments001")),
|
||||||
name: String::from("GoodGirl Listener"),
|
name: String::from("GoodGirl Listener"),
|
||||||
exec_body: actions_util::asyncbox(good_girl),
|
exec_body: actions_util::asyncbox(good_girl),
|
||||||
help: String::from(""),
|
help: String::from(""),
|
||||||
|
@ -73,7 +73,7 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
|
|
||||||
// 1. Define the BotAction
|
// 1. Define the BotAction
|
||||||
let botc1 = BotCommand {
|
let botc1 = BotCommand {
|
||||||
module: BotModule(String::from("experiments001")),
|
module: BotModule::construct(String::from("experiments001")),
|
||||||
command: String::from("babygirl"), // command call name
|
command: String::from("babygirl"), // command call name
|
||||||
alias: vec![], // String of alternative names
|
alias: vec![], // String of alternative names
|
||||||
exec_body: actions_util::asyncbox(babygirl),
|
exec_body: actions_util::asyncbox(babygirl),
|
||||||
|
@ -92,7 +92,7 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
||||||
|
|
||||||
// 1. Define the BotAction
|
// 1. Define the BotAction
|
||||||
let botc1 = BotCommand {
|
let botc1 = BotCommand {
|
||||||
module: BotModule(String::from("experiments001")),
|
module: BotModule::construct(String::from("experiments001")),
|
||||||
command: String::from("rtest"), // command call name
|
command: String::from("rtest"), // command call name
|
||||||
alias: vec![], // String of alternative names
|
alias: vec![], // String of alternative names
|
||||||
exec_body: actions_util::asyncbox(routinelike),
|
exec_body: actions_util::asyncbox(routinelike),
|
||||||
|
|
Loading…
Reference in a new issue