From 7d1c6049fe708cde9f268bf19efcf190c73812f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B4=9B=E6=B0=B4=E5=B1=85=E5=AE=A4?= Date: Wed, 7 Dec 2022 11:26:18 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Will=20not=20send=20the=20origin?= =?UTF-8?q?al=20text=20if=20the=20text=20exceeds=20the=20limit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/other/post.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/other/post.py b/plugins/other/post.py index 17b72a2f..04776f95 100644 --- a/plugins/other/post.py +++ b/plugins/other/post.py @@ -189,9 +189,8 @@ class Post(Plugin.Conversation, BasePlugin.Conversation): post_text += f"{escape_markdown(p.get_text(), version=2)}\n" post_text += f"[source](https://www.miyoushe.com/ys/article/{post_id})" if len(post_text) >= MessageLimit.CAPTION_LENGTH: - await message.reply_markdown_v2(post_text) - post_text = post_text[: MessageLimit.CAPTION_LENGTH - 16 * 3] # 预留一些字 - await message.reply_text(f"警告!图片字符描述已经超过 {MessageLimit.CAPTION_LENGTH} 个字,已经切割并发送原文本") + post_text = post_text[: MessageLimit.CAPTION_LENGTH] + await message.reply_text(f"警告!图片字符描述已经超过 {MessageLimit.CAPTION_LENGTH} 个字,已经切割") try: if len(post_images) > 1: media = [InputMediaPhoto(img_info.data) for img_info in post_images]