2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-29 21:38:04 +00:00

Set Message.text instead of Message.caption in case of web_page previews

This commit is contained in:
Dan 2019-08-01 00:53:17 +02:00
parent d875298937
commit 47e5b9a7cb

View File

@ -602,10 +602,26 @@ class Message(Object, Update):
date=message.date, date=message.date,
chat=Chat._parse(client, message, users, chats), chat=Chat._parse(client, message, users, chats),
from_user=User._parse(client, users.get(message.from_id, None)), from_user=User._parse(client, users.get(message.from_id, None)),
text=Str(message.message).init(entities) or None if media is None else None, text=(
caption=Str(message.message).init(entities) or None if media is not None else None, Str(message.message).init(entities) or None
entities=entities or None if media is None else None, if media is None or web_page is not None
caption_entities=entities or None if media is not None else None, else None
),
caption=(
Str(message.message).init(entities) or None
if media is not None and web_page is None
else None
),
entities=(
entities or None
if media is None or web_page is not None
else None
),
caption_entities=(
entities or None
if media is not None and web_page is None
else None
),
author_signature=message.post_author, author_signature=message.post_author,
forward_from=forward_from, forward_from=forward_from,
forward_sender_name=forward_sender_name, forward_sender_name=forward_sender_name,