L iudZddlZddlmZddlmZmZmZddl m Z ddl m Z m Z ddlmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZmZdd lmZmZm Z ddl!m"Z"m#Z#erddl$m%Z%m&Z&m'Z'm(Z(m)Z)Gdde Z*y)zGThis module contains an object that represents a Telegram ChatFullInfo.N)Sequence) TYPE_CHECKINGOptionalUnion) Birthdate)Chat _ChatBase) ChatLocation)ChatPermissions) ChatPhoto)AcceptedGiftTypes) ReactionType)de_json_optionalde_list_optionalparse_sequence_arg to_timedelta)extract_tzinfo_from_defaultsfrom_timestampget_timedelta_value)JSONDict TimePeriod)Bot BusinessIntroBusinessLocationBusinessOpeningHoursMessagecceZdZdZdZ dBdddedededed ed eed eed eed eedee dee dee edee deddeddeddeddee e deedeedeedeedeejd eed!ee d"ee d#ee d$ee d%eed&eed'ed(d)eed*eed+eed,eed-ee d.ee d/ee d0ee d1eed2ee d3eed4eed5eed6ee d7ee d8eed9eef`fd:Zed;eeeej0ffd<Zed;eeeej0ffd=ZedCd>ed?ed@d;dffdA ZxZS)D ChatFullInfoaH This object contains full information about a chat. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`~telegram.Chat.id` is equal. .. versionadded:: 21.2 .. versionchanged:: 21.3 Explicit support for all shortcut methods known from :class:`telegram.Chat` on this object. Previously those were only available because this class inherited from :class:`telegram.Chat`. .. versionremoved:: 22.3 Removed argument and attribute ``can_send_gift`` deprecated by API 9.0. Args: id (:obj:`int`): Unique identifier for this chat. type (:obj:`str`): Type of chat, can be either :attr:`PRIVATE`, :attr:`GROUP`, :attr:`SUPERGROUP` or :attr:`CHANNEL`. accent_color_id (:obj:`int`, optional): Identifier of the :class:`accent color ` for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors`_ for more details. .. versionadded:: 20.8 max_reaction_count (:obj:`int`): The maximum number of reactions that can be set on a message in the chat. .. versionadded:: 21.2 accepted_gift_types (:class:`telegram.AcceptedGiftTypes`): Information about types of gifts that are accepted by the chat or by the corresponding user for private chats. .. versionadded:: 22.1 title (:obj:`str`, optional): Title, for supergroups, channels and group chats. username (:obj:`str`, optional): Username, for private chats, supergroups and channels if available. first_name (:obj:`str`, optional): First name of the other party in a private chat. last_name (:obj:`str`, optional): Last name of the other party in a private chat. is_forum (:obj:`bool`, optional): :obj:`True`, if the supergroup chat is a forum (has topics_ enabled). .. versionadded:: 20.0 photo (:class:`telegram.ChatPhoto`, optional): Chat photo. active_usernames (Sequence[:obj:`str`], optional): If set, the list of all `active chat usernames `_; for private chats, supergroups and channels. .. versionadded:: 20.0 birthdate (:class:`telegram.Birthdate`, optional): For private chats, the date of birth of the user. .. versionadded:: 21.1 business_intro (:class:`telegram.BusinessIntro`, optional): For private chats with business accounts, the intro of the business. .. versionadded:: 21.1 business_location (:class:`telegram.BusinessLocation`, optional): For private chats with business accounts, the location of the business. .. versionadded:: 21.1 business_opening_hours (:class:`telegram.BusinessOpeningHours`, optional): For private chats with business accounts, the opening hours of the business. .. versionadded:: 21.1 personal_chat (:class:`telegram.Chat`, optional): For private chats, the personal channel of the user. .. versionadded:: 21.1 available_reactions (Sequence[:class:`telegram.ReactionType`], optional): List of available reactions allowed in the chat. If omitted, then all of :const:`telegram.constants.ReactionEmoji` are allowed. .. versionadded:: 20.8 background_custom_emoji_id (:obj:`str`, optional): Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. .. versionadded:: 20.8 profile_accent_color_id (:obj:`int`, optional): Identifier of the :class:`accent color ` for the chat's profile background. See profile `accent colors`_ for more details. .. versionadded:: 20.8 profile_background_custom_emoji_id (:obj:`str`, optional): Custom emoji identifier of the emoji chosen by the chat for its profile background. .. versionadded:: 20.8 emoji_status_custom_emoji_id (:obj:`str`, optional): Custom emoji identifier of emoji status of the chat or the other party in a private chat. .. versionadded:: 20.0 emoji_status_expiration_date (:class:`datetime.datetime`, optional): Expiration date of emoji status of the chat or the other party in a private chat, as a datetime object, if any. |datetime_localization| .. versionadded:: 20.5 bio (:obj:`str`, optional): Bio of the other party in a private chat. has_private_forwards (:obj:`bool`, optional): :obj:`True`, if privacy settings of the other party in the private chat allows to use ``tg://user?id=`` links only in chats with the user. .. versionadded:: 13.9 has_restricted_voice_and_video_messages (:obj:`bool`, optional): :obj:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. .. versionadded:: 20.0 join_to_send_messages (:obj:`bool`, optional): :obj:`True`, if users need to join the supergroup before they can send messages. .. versionadded:: 20.0 join_by_request (:obj:`bool`, optional): :obj:`True`, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators. .. versionadded:: 20.0 description (:obj:`str`, optional): Description, for groups, supergroups and channel chats. invite_link (:obj:`str`, optional): Primary invite link, for groups, supergroups and channel. pinned_message (:class:`telegram.Message`, optional): The most recent pinned message (by sending date). permissions (:class:`telegram.ChatPermissions`): Optional. Default chat member permissions, for groups and supergroups. slow_mode_delay (:obj:`int` | :class:`datetime.timedelta`, optional): For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user. .. versionchanged:: v22.2 |time-period-input| unrestrict_boost_count (:obj:`int`, optional): For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. .. versionadded:: 21.0 message_auto_delete_time (:obj:`int` | :class:`datetime.timedelta`, optional): The time after which all messages sent to the chat will be automatically deleted; in seconds. .. versionadded:: 13.4 .. versionchanged:: v22.2 |time-period-input| has_aggressive_anti_spam_enabled (:obj:`bool`, optional): :obj:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. .. versionadded:: 20.0 has_hidden_members (:obj:`bool`, optional): :obj:`True`, if non-administrators can only get the list of bots and administrators in the chat. .. versionadded:: 20.0 has_protected_content (:obj:`bool`, optional): :obj:`True`, if messages from the chat can't be forwarded to other chats. .. versionadded:: 13.9 has_visible_history (:obj:`bool`, optional): :obj:`True`, if new chat members will have access to old messages; available only to chat administrators. .. versionadded:: 20.8 sticker_set_name (:obj:`str`, optional): For supergroups, name of group sticker set. can_set_sticker_set (:obj:`bool`, optional): :obj:`True`, if the bot can change group the sticker set. custom_emoji_sticker_set_name (:obj:`str`, optional): For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. .. versionadded:: 21.0 linked_chat_id (:obj:`int`, optional): Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. location (:class:`telegram.ChatLocation`, optional): For supergroups, the location to which the supergroup is connected. can_send_paid_media (:obj:`bool`, optional): :obj:`True`, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. .. versionadded:: 21.4 is_direct_messages (:obj:`bool`, optional): :obj:`True`, if the chat is the direct messages chat of a channel. .. versionadded:: 22.4 parent_chat (:obj:`telegram.Chat`, optional): Information about the corresponding channel chat; for direct messages chats only. .. versionadded:: 22.4 Attributes: id (:obj:`int`): Unique identifier for this chat. type (:obj:`str`): Type of chat, can be either :attr:`PRIVATE`, :attr:`GROUP`, :attr:`SUPERGROUP` or :attr:`CHANNEL`. accent_color_id (:obj:`int`): Optional. Identifier of the :class:`accent color ` for the chat name and backgrounds of the chat photo, reply header, and link preview. See `accent colors`_ for more details. .. versionadded:: 20.8 max_reaction_count (:obj:`int`): The maximum number of reactions that can be set on a message in the chat. .. versionadded:: 21.2 accepted_gift_types (:class:`telegram.AcceptedGiftTypes`): Information about types of gifts that are accepted by the chat or by the corresponding user for private chats. .. versionadded:: 22.1 title (:obj:`str`, optional): Title, for supergroups, channels and group chats. username (:obj:`str`, optional): Username, for private chats, supergroups and channels if available. first_name (:obj:`str`, optional): First name of the other party in a private chat. last_name (:obj:`str`, optional): Last name of the other party in a private chat. is_forum (:obj:`bool`, optional): :obj:`True`, if the supergroup chat is a forum (has topics_ enabled). .. versionadded:: 20.0 photo (:class:`telegram.ChatPhoto`): Optional. Chat photo. active_usernames (tuple[:obj:`str`]): Optional. If set, the list of all `active chat usernames `_; for private chats, supergroups and channels. This list is empty if the chat has no active usernames or this chat instance was not obtained via :meth:`~telegram.Bot.get_chat`. .. versionadded:: 20.0 birthdate (:class:`telegram.Birthdate`): Optional. For private chats, the date of birth of the user. .. versionadded:: 21.1 business_intro (:class:`telegram.BusinessIntro`): Optional. For private chats with business accounts, the intro of the business. .. versionadded:: 21.1 business_location (:class:`telegram.BusinessLocation`): Optional. For private chats with business accounts, the location of the business. .. versionadded:: 21.1 business_opening_hours (:class:`telegram.BusinessOpeningHours`): Optional. For private chats with business accounts, the opening hours of the business. .. versionadded:: 21.1 personal_chat (:class:`telegram.Chat`): Optional. For private chats, the personal channel of the user. .. versionadded:: 21.1 available_reactions (tuple[:class:`telegram.ReactionType`]): Optional. List of available reactions allowed in the chat. If omitted, then all of :const:`telegram.constants.ReactionEmoji` are allowed. .. versionadded:: 20.8 background_custom_emoji_id (:obj:`str`): Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. .. versionadded:: 20.8 profile_accent_color_id (:obj:`int`): Optional. Identifier of the :class:`accent color ` for the chat's profile background. See profile `accent colors`_ for more details. .. versionadded:: 20.8 profile_background_custom_emoji_id (:obj:`str`): Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. .. versionadded:: 20.8 emoji_status_custom_emoji_id (:obj:`str`): Optional. Custom emoji identifier of emoji status of the chat or the other party in a private chat. .. versionadded:: 20.0 emoji_status_expiration_date (:class:`datetime.datetime`): Optional. Expiration date of emoji status of the chat or the other party in a private chat, as a datetime object, if any. |datetime_localization| .. versionadded:: 20.5 bio (:obj:`str`): Optional. Bio of the other party in a private chat. has_private_forwards (:obj:`bool`): Optional. :obj:`True`, if privacy settings of the other party in the private chat allows to use ``tg://user?id=`` links only in chats with the user. .. versionadded:: 13.9 has_restricted_voice_and_video_messages (:obj:`bool`): Optional. :obj:`True`, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. .. versionadded:: 20.0 join_to_send_messages (:obj:`bool`): Optional. :obj:`True`, if users need to join the supergroup before they can send messages. .. versionadded:: 20.0 join_by_request (:obj:`bool`): Optional. :obj:`True`, if all users directly joining the supergroup without using an invite link need to be approved by supergroup administrators. .. versionadded:: 20.0 description (:obj:`str`): Optional. Description, for groups, supergroups and channel chats. invite_link (:obj:`str`): Optional. Primary invite link, for groups, supergroups and channel. pinned_message (:class:`telegram.Message`): Optional. The most recent pinned message (by sending date). permissions (:class:`telegram.ChatPermissions`): Optional. Default chat member permissions, for groups and supergroups. slow_mode_delay (:obj:`int` | :class:`datetime.timedelta`): Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user. .. deprecated:: v22.2 |time-period-int-deprecated| unrestrict_boost_count (:obj:`int`): Optional. For supergroups, the minimum number of boosts that a non-administrator user needs to add in order to ignore slow mode and chat permissions. .. versionadded:: 21.0 message_auto_delete_time (:obj:`int` | :class:`datetime.timedelta`): Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. .. versionadded:: 13.4 .. deprecated:: v22.2 |time-period-int-deprecated| has_aggressive_anti_spam_enabled (:obj:`bool`): Optional. :obj:`True`, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. .. versionadded:: 20.0 has_hidden_members (:obj:`bool`): Optional. :obj:`True`, if non-administrators can only get the list of bots and administrators in the chat. .. versionadded:: 20.0 has_protected_content (:obj:`bool`): Optional. :obj:`True`, if messages from the chat can't be forwarded to other chats. .. versionadded:: 13.9 has_visible_history (:obj:`bool`): Optional. :obj:`True`, if new chat members will have access to old messages; available only to chat administrators. .. versionadded:: 20.8 sticker_set_name (:obj:`str`): Optional. For supergroups, name of Group sticker set. can_set_sticker_set (:obj:`bool`): Optional. :obj:`True`, if the bot can change group the sticker set. custom_emoji_sticker_set_name (:obj:`str`): Optional. For supergroups, the name of the group's custom emoji sticker set. Custom emoji from this set can be used by all users and bots in the group. .. versionadded:: 21.0 linked_chat_id (:obj:`int`): Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. location (:class:`telegram.ChatLocation`): Optional. For supergroups, the location to which the supergroup is connected. can_send_paid_media (:obj:`bool`): Optional. :obj:`True`, if paid media messages can be sent or forwarded to the channel chat. The field is available only for channel chats. .. versionadded:: 21.4 is_direct_messages (:obj:`bool`): Optional. :obj:`True`, if the chat is the direct messages chat of a channel. .. versionadded:: 22.4 parent_chat (:obj:`telegram.Chat`): Optional. Information about the corresponding channel chat; for direct messages chats only. .. versionadded:: 22.4 .. _accent colors: https://core.telegram.org/bots/api#accent-colors .. _topics: https://telegram.org/blog/topics-in-groups-collectible-usernames#topics-in-groups )'_message_auto_delete_time_slow_mode_delayaccent_color_idaccepted_gift_typesactive_usernamesavailable_reactionsbackground_custom_emoji_idbio birthdatebusiness_introbusiness_locationbusiness_opening_hourscan_send_paid_mediacan_set_sticker_setcustom_emoji_sticker_set_name descriptionemoji_status_custom_emoji_idemoji_status_expiration_date has_aggressive_anti_spam_enabledhas_hidden_membershas_private_forwardshas_protected_content'has_restricted_voice_and_video_messageshas_visible_history invite_linkjoin_by_requestjoin_to_send_messageslinked_chat_idlocationmax_reaction_count parent_chat permissions personal_chatphotopinned_messageprofile_accent_color_id"profile_background_custom_emoji_idsticker_set_nameunrestrict_boost_countN) api_kwargsidtyper!r<r"titleusername first_name last_nameis_forumr@r#r'r(rr)rr*rr?rr$r%rBrCr/r0r&r3r5r9r8r.r7rArr>slow_mode_delayrEmessage_auto_delete_timer1r2r4r6rDr,r-r:r;r+is_direct_messagesr=rFc0 t1||||||| | |.|0 |j5||_| |_||_||_||_||_||_ | |_ t|!|_ t|#|_ |&|_|'|_|(|_|)|_|+|_|,|_||_||_||_t/| |_||_||_|$|_|%|_t/||_||_||_||_ ||_!|"|_"|*|_#| |_$||_%||_&||_'||_(|-|_)||_*|/|_+dddy#1swYyxYw)N) rGrHrIrJrKrLrMrPrF),super__init__ _unfrozenr<r@r&r3r.r7rAr>rr rr4r6rDr,r:r;r9r8r5rr#r/r0r1r2r$r!r%rBrCrEr-r'r?r(r)r*r+r"r=)2selfrGrHr!r<r"rIrJrKrLrMr@r#r'r(r)r*r?r$r%rBrCr/r0r&r3r5r9r8r.r7rAr>rNrErOr1r2r4r6rDr,r-r:r;r+rPr=rF __class__s2 \/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_chatfullinfo.pyrSzChatFullInfo.__init__sh !1!  ^^ 3 ;+=D #.3DJ&)DH8LD %.9D .9D 5CD :ED =I/=ZD !FR(GD *:OD &7JD $3CD !7JD $1?D 4D ;ID ARD "J`D '7JD $:MD $/:D g3 ;3 ;3 ;s D6E))E2returnc0t|jdS)NrN attribute)rr rUs rWrNzChatFullInfo.slow_mode_delay;s"4#8#8DUVVc0t|jdS)NrOrZ)rrr\s rWrOz%ChatFullInfo.message_auto_delete_time?s"  * *6P  r]databotrc|j|}t|}t|jd||d<t |jdt ||d<t |jdt ||d<ddlm}m }m }m }t |jd|||d<t |jdt||d<t |jd t||d <t|jd t||d <t |jd t ||d <t |jd t"||d <t |jd |||d <t |jd|||d<t |jd|||d<t |jdt"||d<t$|M||S)z,See :meth:`telegram.TelegramObject.de_json`.r0)tzinfor@r"r)rrrrrAr>r;r$r'r?r(r)r*r=)r_r`) _parse_datarrgetrr r telegramrrrrr r rrrrrRde_json) clsr_r` loc_tzinforrrrrVs rWrfzChatFullInfo.de_jsonEst$2#6 /= HH3 4Z0  +,)'):IsKW &6 HH* +->'  "#  "2$((;K2LgWZ![ .txx /FY\]]+DHHZ,@,PSTZ&6 HH* +\3'  "#-TXXk-BIsS[ 0/1JDRU V_!1$((;K2Lm]`!a $4 HH( )+;S%  !*: HH- .0Dc*  %&/txx /FcR]wDc22r])*NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN)N)__name__ __module__ __qualname____doc__ __slots__intstrr rboolr rrrdtmdatetimer rr rrrSpropertyr timedeltarNrO classmethodrf __classcell__)rVs@rWrr2s/gR (Ib $"&$(#'#'%)48)-48:>CG*.@D4815<@6:?C!/3BF04*.%)%).21504049=;?-104.2*..27;(,+/.2-1&*as;d*.es; s;s; s;  s; / s;}s;3-s;SMs;C=s;4.s; "s;#8C=1s;I&s;!1s; $$67!s;"!))? @#s;$ '%s;&&h|&<='s;(%-SM)s;*"*#+s;,-5SM-s;.'/sm/s;0'/s||&<1s;2c]3s;4'tn5s;62:$7s;8 (~9s;:"$;s;<c]=s;>c]?s;@!+As;Bo.Cs;D"*-Es;F!) Gs;H#+:"6Is;J+34.Ks;L%TNMs;N (~Os;P&d^Qs;R#3-Ss;T&d^Us;V(0}Ws;X! Ys;Z<([s;\&d^]s;^%TN_s;`d^as;dX&es;jW%S]]0B*C!DWW (5cmm9K3L*M  (38(3(5/(3^(3(3r]r)+rlrrrqcollections.abcrtypingrrrtelegram._birthdatertelegram._chatrr telegram._chatlocationr telegram._chatpermissionsr telegram._files.chatphotor telegram._giftsr telegram._reactionrtelegram._utils.argumentparsingrrrrtelegram._utils.datetimerrrtelegram._utils.typesrrrerrrrrrr]rWrs\(N$11)*/5/-+  7\\|39|3r]