Add the field has_media_spoiler to the class Message

This commit is contained in:
Dan 2022-12-30 15:06:51 +01:00 committed by wulan17
parent b0ac808f2e
commit b865512c68
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -147,6 +147,9 @@ class Message(Object, Update):
has_protected_content (``bool``, *optional*):
True, if the message can't be forwarded.
has_media_spoiler (``bool``, *optional*):
True, if the message media is covered by a spoiler animation.
text (``str``, *optional*):
For text messages, the actual UTF-8 text of the message, 0-4096 characters.
If the message contains entities (bold, italic, ...) you can access *text.markdown* or
@ -367,6 +370,7 @@ class Message(Object, Update):
media_group_id: str = None,
author_signature: str = None,
has_protected_content: bool = None,
has_media_spoiler: bool = None,
text: Str = None,
entities: List["types.MessageEntity"] = None,
caption_entities: List["types.MessageEntity"] = None,
@ -453,6 +457,7 @@ class Message(Object, Update):
self.media_group_id = media_group_id
self.author_signature = author_signature
self.has_protected_content = has_protected_content
self.has_media_spoiler = has_media_spoiler
self.text = text
self.entities = entities
self.caption_entities = caption_entities
@ -884,6 +889,7 @@ class Message(Object, Update):
),
author_signature=message.post_author,
has_protected_content=message.noforwards,
has_media_spoiler=media and media.spoiler,
forward_from=forward_from,
forward_sender_name=forward_sender_name,
forward_from_chat=forward_from_chat,