L iy'dZddlZddlmZmZmZddlmZddl m Z ddl m Z ddl mZddlmZdd lmZdd lmZmZdd lmZerdd lmZGd de ZGddeZGddeZGddeZGddeZy)zFThis module contains the classes that represent Telegram MessageOigin.N) TYPE_CHECKINGFinalOptional) constants)Chat)TelegramObject)User)enum)de_json_optional)extract_tzinfo_from_defaultsfrom_timestamp)JSONDict)BotcxeZdZUdZdZej jZee e d< ej jZ ee e d< ej jZ ee e d< ej jZ ee e d< ddd e d ejd eeffd Zedd ededddffd ZxZS) MessageOrigina Base class for telegram MessageOrigin object, it can be one of: * :class:`MessageOriginUser` * :class:`MessageOriginHiddenUser` * :class:`MessageOriginChat` * :class:`MessageOriginChannel` Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`type` and :attr:`date` are equal. .. versionadded:: 20.8 Args: type (:obj:`str`): Type of the message origin, can be on of: :attr:`~telegram.MessageOrigin.USER`, :attr:`~telegram.MessageOrigin.HIDDEN_USER`, :attr:`~telegram.MessageOrigin.CHAT`, or :attr:`~telegram.MessageOrigin.CHANNEL`. date (:obj:`datetime.datetime`): Date the message was sent originally. |datetime_localization| Attributes: type (:obj:`str`): Type of the message origin, can be on of: :attr:`~telegram.MessageOrigin.USER`, :attr:`~telegram.MessageOrigin.HIDDEN_USER`, :attr:`~telegram.MessageOrigin.CHAT`, or :attr:`~telegram.MessageOrigin.CHANNEL`. date (:obj:`datetime.datetime`): Date the message was sent originally. |datetime_localization| )datetypeUSER HIDDEN_USERCHATCHANNELN api_kwargsrrrct||tjtj |||_||_|j |jf|_|jy)Nr) super__init__r get_memberrMessageOriginTyperr _id_attrs_freeze)selfrrr __class__s ]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_messageorigin.pyrzMessageOrigin.__init__PsZ J/)D)DdDQ "&  II II  databotrreturnc|j|}|jt|jt|j t |jti}|tur8|jd|vr%||jdj||St|}t|jd||d<d|vr#t|jdt ||d<d|vr#t|jdt"||d<d|vr#t|jdt"||d<t$|1||S)zConverts JSON data to the appropriate :class:`MessageOrigin` object, i.e. takes care of selecting the correct subclass. r)r%r&r)tzinfo sender_user sender_chatchat) _parse_datarMessageOriginUserrMessageOriginHiddenUserrMessageOriginChatrMessageOriginChannelrgetpopde_jsonr r r r rr)clsr%r&_class_mapping loc_tzinfor"s r#r4zMessageOrigin.de_jsonbs$ t$ HH' OO4 HH' KK- :  - DHHV$4$F!$((6"23;;3;O O1#6 %dhhv&6zJV D "2488M3JDRU"VD  D "2488M3JDRU"VD  T>+DHHV,rrrrCrDs@r#r/r/sC$&I*. :ll : : X& : :r$r/c beZdZdZdZ d dddej dedee dee ffd Z xZ S) r0a The message was originally sent on behalf of a chat to a group chat. .. versionadded:: 20.8 Args: date (:obj:`datetime.datetime`): Date the message was sent originally. |datetime_localization| sender_chat (:class:`telegram.Chat`): Chat that sent the message originally. author_signature (:obj:`str`, optional): For messages originally sent by an anonymous chat administrator, original message author signature Attributes: type (:obj:`str`): Type of the message origin. Always :tg-const:`~telegram.MessageOrigin.CHAT`. date (:obj:`datetime.datetime`): Date the message was sent originally. |datetime_localization| sender_chat (:class:`telegram.Chat`): Chat that sent the message originally. author_signature (:obj:`str`): Optional. For messages originally sent by an anonymous chat administrator, original message author signature )author_signaturer+Nrrr+rNrct||j|||j5||_||_dddy#1swYyxYwrG)rrrrHr+rN)r!rr+rNrr"s r#rzMessageOriginChat.__init__sP diidzJ ^^  D%0D 3CD ! D D Ds AAr8) r9r:r;r<r=r@rArrr>rrrCrDs@r#r0r0sb,I+/ D *. Dll D D#3- D X& D Dr$r0c feZdZdZdZ d dddej dedede e d e e f fd Z xZ S) r1a The message was originally sent to a channel chat. .. versionadded:: 20.8 Args: date (:obj:`datetime.datetime`): Date the message was sent originally. |datetime_localization| chat (:class:`telegram.Chat`): Channel chat to which the message was originally sent. message_id (:obj:`int`): Unique message identifier inside the chat. author_signature (:obj:`str`, optional): Signature of the original post author. Attributes: type (:obj:`str`): Type of the message origin. Always :tg-const:`~telegram.MessageOrigin.CHANNEL`. date (:obj:`datetime.datetime`): Date the message was sent originally. |datetime_localization| chat (:class:`telegram.Chat`): Channel chat to which the message was originally sent. message_id (:obj:`int`): Unique message identifier inside the chat. author_signature (:obj:`str`): Optional. Signature of the original post author. )rNr, message_idNrrr,rQrNrct||j|||j5||_||_||_dddy#1swYyxYwrG)rrrrHr,rQrN)r!rr,rQrNrr"s r#rzMessageOriginChannel.__init__ sV dll*M ^^  D"DI#-DO3CD ! D D Ds A  Ar8)r9r:r;r<r=r@rArintrr>rrrCrDs@r#r1r1sm,I+/ D*.DllDD D #3- DX&DDr$r1)r<rAr@typingrrrtelegramrtelegram._chatrtelegram._telegramobjectrtelegram._userr telegram._utilsr telegram._utils.argumentparsingr telegram._utils.datetimer r telegram._utils.typesrrrr.r/r0r1r$r#r^sx&M113 <Q*Y3NY3x1 1D:m:D(D (DV+D=+Dr$