mirror of
https://github.com/FuQuan233/nonebot-plugin-llmchat.git
synced 2025-09-04 18:30:43 +00:00
♻️ Replace manual whitespace removal loops with built-in string strip method
This commit is contained in:
parent
8e6dfe4f14
commit
46d854aeae
1 changed files with 1 additions and 4 deletions
|
@ -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]}..."
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue