custom more intuitive
All checks were successful
ci/woodpecker/push/cargo-checks Pipeline was successful
ci/woodpecker/pr/cargo-checks Pipeline was successful

This commit is contained in:
ModulatingForce 2024-03-12 21:59:02 -04:00
parent 16d19ca9b4
commit 607515757e

View file

@ -15,27 +15,33 @@ use std::sync::Arc;
use twitch_irc::message::PrivmsgMessage; 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::botlog;
use crate::core::bot_actions::actions_util::{self, BotAR}; use crate::core::bot_actions::actions_util::{self, BotAR};
use crate::core::botmodules::{BotActionTrait, BotCommand, BotModule, Listener, ModulesManager}; 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<ModulesManager>) { pub async fn init(mgr: Arc<ModulesManager>) {
const OF_CMD_CHANNEL:ChType = Channel(String::new());
// 1. Define the BotAction // 1. Define the BotAction
let botc1 = BotCommand { let botc1 = BotCommand {
module: BotModule(String::from("experiments001")), module: BotModule(String::from("experiments001")),
command: String::from("test1"), // command call name 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), exec_body: actions_util::asyncbox(testy),
help: String::from("Test Command tester"), help: String::from("Test Command tester"),
required_roles: vec![UserRole::BotAdmin, required_roles: vec![
UserRole::Mod(Channel(String::new())) BotAdmin,
], Mod(OF_CMD_CHANNEL),
],
}; };
// 2. Add the BotAction to ModulesManager // 2. Add the BotAction to ModulesManager