MessageOrigin¶
- class telegram.MessageOrigin(type, date, *, api_kwargs=None)[source]¶
Bases:
telegram.TelegramObject
Base class for telegram MessageOrigin object, it can be one of:
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
type
anddate
are equal.Added in version 20.8.
- Parameters:
type (
str
) – Type of the message origin, can be on of:USER
,HIDDEN_USER
,CHAT
, orCHANNEL
.date (
datetime.datetime
) – Date the message was sent originally. The default timezone of the bot is used for localization, which is UTC unlesstelegram.ext.Defaults.tzinfo
is used.
- date[source]¶
Date the message was sent originally. The default timezone of the bot is used for localization, which is UTC unless
telegram.ext.Defaults.tzinfo
is used.- Type:
- classmethod de_json(data, bot=None)[source]¶
Converts JSON data to the appropriate
MessageOrigin
object, i.e. takes care of selecting the correct subclass.