mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-16 12:02:16 +00:00
🎨 Will not send the original text if the text exceeds the limit
This commit is contained in:
parent
f2b89134cb
commit
7d1c6049fe
@ -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]
|
||||
|
Loading…
Reference in New Issue
Block a user