From 308b76dc7d985e8174047ae42832d44d9a298cae Mon Sep 17 00:00:00 2001 From: LambdaYH Date: Mon, 22 Aug 2022 00:38:25 +0800 Subject: [PATCH] =?UTF-8?q?=5Frule=E4=B8=AD=E4=BD=BF=E7=94=A8messagesegmen?= =?UTF-8?q?t=E4=B8=AD=E6=9C=AA=E8=BD=AC=E4=B9=89=E7=9A=84=E5=AD=97?= =?UTF-8?q?=E7=AC=A6=E4=B8=B2=EF=BC=8C=E8=80=8C=E6=B7=BB=E5=8A=A0=E8=AF=8D?= =?UTF-8?q?=E6=9D=A1=E6=97=B6=E4=BD=BF=E7=94=A8=E4=BA=86=E8=BD=AC=E4=B9=89?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E5=AD=97=E7=AC=A6=E4=B8=B2=EF=BC=8C=E5=AF=BC?= =?UTF-8?q?=E8=87=B4=E4=BA=8C=E8=80=85=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/word_bank/word_handle.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/word_bank/word_handle.py b/plugins/word_bank/word_handle.py index 7762ce3b..8802a2f0 100644 --- a/plugins/word_bank/word_handle.py +++ b/plugins/word_bank/word_handle.py @@ -128,7 +128,8 @@ async def _( temp += f"[at:{g.data['qq']}]" problem = temp break - index = len((word_scope or "") + "添加词条" + (word_type or "") + unescape(problem)) + 1 + problem = unescape(problem) + index = len((word_scope or "") + "添加词条" + (word_type or "") + problem) + 1 event.message[0] = event.message[0].data["text"][index + 1 :].strip() state["word_scope"] = word_scope state["word_type"] = word_type @@ -148,7 +149,6 @@ async def _( try: if word_type == "正则": try: - problem = unescape(problem) re.compile(problem) except re.error: await add_word.finish(f"添加词条失败,正则表达式 {problem} 非法!")