From 901506a32d20a938801d12b608d17d6df67fb4c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B6=B5=E6=9B=A6?= Date: Mon, 8 Jul 2024 01:06:01 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=94=A4=E9=86=92=E5=8F=A3=E4=BB=A4?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E6=94=AF=E6=8C=81=E9=85=8D=E8=AF=AD=E9=9F=B3?= =?UTF-8?q?=E8=AF=8D=EF=BC=8C=E7=AE=80=E5=8C=96=E8=87=AA=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E5=8F=A3=E4=BB=A4=E9=85=8D=E7=BD=AE=20see=20#105?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- xiaomusic/xiaomusic.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/xiaomusic/xiaomusic.py b/xiaomusic/xiaomusic.py index 9c5b9be30..331418399 100644 --- a/xiaomusic/xiaomusic.py +++ b/xiaomusic/xiaomusic.py @@ -712,10 +712,17 @@ def match_cmd(self, query, ctrl_panel): 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: - self.log.info(f"不在激活命令中 {opvalue}") - continue + + 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}")