feat: 唤醒口令配置支持配语音词,简化自定义口令配置 see #105

This commit is contained in:
涵曦 2024-07-08 01:06:01 +00:00
parent 0ddbe58fbd
commit 901506a32d

View File

@ -712,10 +712,17 @@ class XiaoMusic:
if opkey in KEY_WORD_ARG_BEFORE_DICT:
oparg = argpre
opvalue = self.config.key_word_dict.get(opkey)
if not ctrl_panel and not self.isplaying():
if self.active_cmd and opvalue not in self.active_cmd:
if (
(not ctrl_panel)
and (not self.isplaying())
and self.active_cmd
and (opvalue not in self.active_cmd)
and (opkey not in self.active_cmd)
):
self.log.info(f"不在激活命令中 {opvalue}")
continue
self.log.info(f"匹配到指令. opkey:{opkey} opvalue:{opvalue} oparg:{oparg}")
return (opvalue, oparg)
self.log.info(f"未匹配到指令 {query} {ctrl_panel}")