Add the field has_media_spoiler to the class Message

This commit is contained in:
Dan 2022-12-30 15:06:51 +01:00
parent e0dda5ab26
commit ef29b3c519

View File

@ -136,6 +136,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
@ -332,6 +335,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,
@ -408,6 +412,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
@ -777,6 +782,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,