From 46d854aeaee47c099d80d314ffaba1b343f45b90 Mon Sep 17 00:00:00 2001 From: FuQuan233 Date: Sat, 15 Feb 2025 16:44:30 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20Replace=20manual=20whitesp?= =?UTF-8?q?ace=20removal=20loops=20with=20built-in=20string=20strip=20meth?= =?UTF-8?q?od?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- nonebot_plugin_llmchat/__init__.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/nonebot_plugin_llmchat/__init__.py b/nonebot_plugin_llmchat/__init__.py index 4a691a7..145e773 100644 --- a/nonebot_plugin_llmchat/__init__.py +++ b/nonebot_plugin_llmchat/__init__.py @@ -256,10 +256,7 @@ async def process_messages(group_id: int): if r.__len__() < 1: continue # 删除前后多余的换行和空格 - while r[0] == "\n" or r[0] == " ": - r = r[1:] - while r[-1] == "\n" or r[0] == " ": - r = r[:-1] + r = r.strip() await asyncio.sleep(2) logger.debug( f"发送消息分段 内容:{r[:50]}..."