From 16d19ca9b42e7b0828a006fb854c57e02db18f9d Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Tue, 5 Mar 2024 22:16:09 -0500 Subject: [PATCH] adj import in custom module more intuitive with longer named UserRoles like Mod and and SupMod that requires channel --- src/core/botinstance.rs | 2 +- src/custom/experiments.rs | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/core/botinstance.rs b/src/core/botinstance.rs index e31077f..ea8e03c 100644 --- a/src/core/botinstance.rs +++ b/src/core/botinstance.rs @@ -278,7 +278,7 @@ impl BotInstance { }; botlog::trace( - "Checking if permissible", + "Checked if permissible", Some("BotInstance > listener_main_prvmsg()".to_string()), Some(msg), ); diff --git a/src/custom/experiments.rs b/src/custom/experiments.rs index 462630f..e383696 100644 --- a/src/custom/experiments.rs +++ b/src/custom/experiments.rs @@ -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) { + + // 1. Define the BotAction let botc1 = BotCommand { module: BotModule(String::from("experiments001")), @@ -30,7 +33,9 @@ pub async fn init(mgr: Arc) { 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