diff --git a/telegram/_message.py b/telegram/_message.py index 62848565a3d..4036511e210 100644 --- a/telegram/_message.py +++ b/telegram/_message.py @@ -302,6 +302,9 @@ class Message(MaybeInaccessibleMessage): forwarded. .. versionadded:: 13.9 + is_from_offline (:obj:`bool`, optional): :obj:`True`, if the message was sent + by an implicit action, for example, as an away or a greeting business message, + or as a scheduled message. media_group_id (:obj:`str`, optional): The unique identifier of a media message group this message belongs to. text (:obj:`str`, optional): For text messages, the actual UTF-8 text of the message, @@ -581,6 +584,9 @@ class Message(MaybeInaccessibleMessage): forwarded. .. versionadded:: 13.9 + is_from_offline (:obj:`bool`): Optional. :obj:`True`, if the message was sent + by an implicit action, for example, as an away or a greeting business message, + or as a scheduled message. media_group_id (:obj:`str`): Optional. The unique identifier of a media message group this message belongs to. text (:obj:`str`): Optional. For text messages, the actual UTF-8 text of the message, @@ -890,6 +896,7 @@ class Message(MaybeInaccessibleMessage): "has_protected_content", "invoice", "is_automatic_forward", + "is_from_offline", "is_topic_message", "left_chat_member", "link_preview_options", @@ -1014,6 +1021,7 @@ def __init__( sender_boost_count: Optional[int] = None, business_connection_id: Optional[str] = None, sender_business_bot: Optional[User] = None, + is_from_offline: Optional[bool] = None, *, api_kwargs: Optional[JSONDict] = None, ): @@ -1111,6 +1119,7 @@ def __init__( self.sender_boost_count: Optional[int] = sender_boost_count self.business_connection_id: Optional[str] = business_connection_id self.sender_business_bot: Optional[User] = sender_business_bot + self.is_from_offline: Optional[bool] = is_from_offline self._effective_attachment = DEFAULT_NONE diff --git a/tests/test_constants.py b/tests/test_constants.py index 5055f75795c..04dc6700564 100644 --- a/tests/test_constants.py +++ b/tests/test_constants.py @@ -176,6 +176,7 @@ def is_type_attribute(name: str) -> bool: # attribute is deprecated, no need to add it to MessageType "user_shared", "via_bot", + "is_from_offline", }: return False diff --git a/tests/test_message.py b/tests/test_message.py index dc2a0bfe15f..bd7dff92d6d 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -263,6 +263,7 @@ def message(bot): {"reply_to_story": Story(Chat(1, Chat.PRIVATE), 0)}, {"boost_added": ChatBoostAdded(100)}, {"sender_boost_count": 1}, + {"is_from_offline": True}, {"sender_business_bot": User(1, "BusinessBot", True)}, {"business_connection_id": "123456789"}, ], @@ -332,6 +333,7 @@ def message(bot): "sender_boost_count", "sender_business_bot", "business_connection_id", + "is_from_offline", ], ) def message_params(bot, request):
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: