From 607515757eeda8423a056ba73a2ec2a5095cca77 Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Tue, 12 Mar 2024 21:59:02 -0400 Subject: [PATCH] custom more intuitive --- src/custom/experiments.rs | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/custom/experiments.rs b/src/custom/experiments.rs index e383696..8b1bece 100644 --- a/src/custom/experiments.rs +++ b/src/custom/experiments.rs @@ -15,27 +15,33 @@ use std::sync::Arc; use twitch_irc::message::PrivmsgMessage; -use crate::core::botinstance::ChType::Channel; +// use crate::core::botinstance::ChType::Channel; +use crate::core::botinstance::ChType; +use 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::UserRole; +use crate::core::identity::UserRole::*; pub async fn init(mgr: Arc) { + const OF_CMD_CHANNEL:ChType = Channel(String::new()); // 1. Define the BotAction let botc1 = BotCommand { module: BotModule(String::from("experiments001")), command: String::from("test1"), // command call name - alias: vec![String::from("tester1"), String::from("testy1")], // String of alternative names + 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![UserRole::BotAdmin, - UserRole::Mod(Channel(String::new())) - ], + required_roles: vec![ + BotAdmin, + Mod(OF_CMD_CHANNEL), + ], }; // 2. Add the BotAction to ModulesManager