From d687f9329ece6aede01466b01a815ce9bbebf2dd Mon Sep 17 00:00:00 2001 From: lanvent Date: Fri, 7 Apr 2023 12:28:01 +0800 Subject: [PATCH] fix: add maxsplit=1 in wechatmp --- channel/wechatmp/wechatmp_channel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/channel/wechatmp/wechatmp_channel.py b/channel/wechatmp/wechatmp_channel.py index 12878a7..1ac98cf 100644 --- a/channel/wechatmp/wechatmp_channel.py +++ b/channel/wechatmp/wechatmp_channel.py @@ -223,7 +223,7 @@ class SubsribeAccountQuery(): channel.cache_dict.pop(cache_key) else: continue_text = "\n【未完待续,回复任意文字以继续】" - splits = split_string_by_utf8_length(content, MAX_UTF8_LEN - len(continue_text.encode('utf-8'))) + splits = split_string_by_utf8_length(content, MAX_UTF8_LEN - len(continue_text.encode('utf-8')), max_split= 1) reply_text = splits[0] + continue_text channel.cache_dict[cache_key] = splits[1] logger.info("[wechatmp] {}:{} Do send {}".format(web.ctx.env.get('REMOTE_ADDR'), web.ctx.env.get('REMOTE_PORT'), reply_text))