mirror of
https://github.com/PaiGramTeam/PaiGram.git
synced 2024-11-25 09:37:30 +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"{escape_markdown(p.get_text(), version=2)}\n"
|
||||||
post_text += f"[source](https://www.miyoushe.com/ys/article/{post_id})"
|
post_text += f"[source](https://www.miyoushe.com/ys/article/{post_id})"
|
||||||
if len(post_text) >= MessageLimit.CAPTION_LENGTH:
|
if len(post_text) >= MessageLimit.CAPTION_LENGTH:
|
||||||
await message.reply_markdown_v2(post_text)
|
post_text = post_text[: MessageLimit.CAPTION_LENGTH]
|
||||||
post_text = post_text[: MessageLimit.CAPTION_LENGTH - 16 * 3] # 预留一些字
|
await message.reply_text(f"警告!图片字符描述已经超过 {MessageLimit.CAPTION_LENGTH} 个字,已经切割")
|
||||||
await message.reply_text(f"警告!图片字符描述已经超过 {MessageLimit.CAPTION_LENGTH} 个字,已经切割并发送原文本")
|
|
||||||
try:
|
try:
|
||||||
if len(post_images) > 1:
|
if len(post_images) > 1:
|
||||||
media = [InputMediaPhoto(img_info.data) for img_info in post_images]
|
media = [InputMediaPhoto(img_info.data) for img_info in post_images]
|
||||||
|
Loading…
Reference in New Issue
Block a user