From 6dbda7c0d78fe3cf9f05abab2b084df1d9d7b285 Mon Sep 17 00:00:00 2001 From: MistEO Date: Mon, 11 Dec 2023 00:16:34 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E2=80=9C=E7=89=9B?= =?UTF-8?q?=E7=89=9B=E7=BB=A7=E7=BB=AD=E5=94=B1=E2=80=9D=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugins/sing/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/plugins/sing/__init__.py b/src/plugins/sing/__init__.py index be33ffb..39a7217 100644 --- a/src/plugins/sing/__init__.py +++ b/src/plugins/sing/__init__.py @@ -35,7 +35,7 @@ async def is_to_sing(bot: Bot, event: Event, state: T_State) -> bool: if not text: return False - if not SING_CMD in text: + if not SING_CMD in text and not any([cmd in text for cmd in SING_CONTINUE_CMDS]): return False if text.endswith(SING_CMD): @@ -75,8 +75,11 @@ async def is_to_sing(bot: Bot, event: Event, state: T_State) -> bool: state['chunk_index'] = 0 return True - progress = GroupConfig(group_id=event.group_id).sing_progress() - if text in SING_CONTINUE_CMDS and progress: + if text in SING_CONTINUE_CMDS: + progress = GroupConfig(group_id=event.group_id).sing_progress() + if not progress: + return False + song_id = progress['song_id'] chunk_index = progress['chunk_index'] key_val = progress['key']