adj import in custom module
All checks were successful
ci/woodpecker/push/cargo-checks Pipeline was successful
All checks were successful
ci/woodpecker/push/cargo-checks Pipeline was successful
more intuitive with longer named UserRoles like Mod and and SupMod that requires channel
This commit is contained in:
parent
9cfc54394d
commit
16d19ca9b4
2 changed files with 8 additions and 3 deletions
|
@ -278,7 +278,7 @@ impl BotInstance {
|
|||
};
|
||||
|
||||
botlog::trace(
|
||||
"Checking if permissible",
|
||||
"Checked if permissible",
|
||||
Some("BotInstance > listener_main_prvmsg()".to_string()),
|
||||
Some(msg),
|
||||
);
|
||||
|
|
|
@ -15,14 +15,17 @@ use std::sync::Arc;
|
|||
|
||||
use twitch_irc::message::PrivmsgMessage;
|
||||
|
||||
use crate::core::botinstance::ChType::Channel;
|
||||
use crate::core::botlog;
|
||||
|
||||
use crate::core::bot_actions::actions_util::{self, BotAR};
|
||||
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, Listener, ModulesManager};
|
||||
|
||||
use crate::core::identity;
|
||||
use crate::core::identity::UserRole;
|
||||
|
||||
pub async fn init(mgr: Arc<ModulesManager>) {
|
||||
|
||||
|
||||
// 1. Define the BotAction
|
||||
let botc1 = BotCommand {
|
||||
module: BotModule(String::from("experiments001")),
|
||||
|
@ -30,7 +33,9 @@ pub async fn init(mgr: Arc<ModulesManager>) {
|
|||
alias: vec![String::from("tester1"), String::from("testy1")], // String of alternative names
|
||||
exec_body: actions_util::asyncbox(testy),
|
||||
help: String::from("Test Command tester"),
|
||||
required_roles: vec![identity::UserRole::BotAdmin],
|
||||
required_roles: vec![UserRole::BotAdmin,
|
||||
UserRole::Mod(Channel(String::new()))
|
||||
],
|
||||
};
|
||||
|
||||
// 2. Add the BotAction to ModulesManager
|
||||
|
|
Loading…
Reference in a new issue