puniyu_handler_command 0.8.0

puniyu 命令处理器,统一命令匹配、权限检查与执行分发流程
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use puniyu_config::ReactiveMode;
use puniyu_config::bot_config;

pub fn get_bot_alias(bot_id: &str) -> Vec<String> {
	let bot_config = bot_config();
	let bot_option = bot_config.bot(bot_id);
	let aliases = bot_option.alias();
	if aliases.is_empty() { bot_config.global().alias() } else { aliases }
}

pub fn get_bot_reactive_mode(bot_id: &str) -> ReactiveMode {
	let bot_config = bot_config();
	let bot_option = bot_config.bot(bot_id);
	bot_option.mode()
}