L i$dZddlmZmZddlmZddlmZmZddl m Z ddl m Z ddl mZddlmZerdd lmZGd d e Zy ) zIThis module contains an object that represents a Telegram KeyboardButton.) TYPE_CHECKINGOptional)KeyboardButtonPollType)KeyboardButtonRequestChatKeyboardButtonRequestUsers)TelegramObject)de_json_optional)JSONDict) WebAppInfo)BotceZdZdZdZ ddddedeedeedeed ee d ee d ee d ee ffd Z edde dedddffd ZxZS)KeyboardButtonat This object represents one button of the reply keyboard. At most one of the optional fields must be used to specify type of the button. For simple text buttons, :obj:`str` can be used instead of this object to specify text of the button. Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`text`, :attr:`request_contact`, :attr:`request_location`, :attr:`request_poll`, :attr:`web_app`, :attr:`request_users` and :attr:`request_chat` are equal. Note: * Optional fields are mutually exclusive. * :attr:`request_contact` and :attr:`request_location` options will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message. * :attr:`request_poll` option will only work in Telegram versions released after 23 January, 2020. Older clients will display unsupported message. * :attr:`web_app` option will only work in Telegram versions released after 16 April, 2022. Older clients will display unsupported message. * :attr:`request_users` and :attr:`request_chat` options will only work in Telegram versions released after 3 February, 2023. Older clients will display unsupported message. .. versionchanged:: 21.0 Removed deprecated argument and attribute ``request_user``. .. versionchanged:: 20.0 :attr:`web_app` is considered as well when comparing objects of this type in terms of equality. .. versionchanged:: 20.5 :attr:`request_users` and :attr:`request_chat` are considered as well when comparing objects of this type in terms of equality. Args: text (:obj:`str`): Text of the button. If none of the optional fields are used, it will be sent to the bot as a message when the button is pressed. request_contact (:obj:`bool`, optional): If :obj:`True`, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. request_location (:obj:`bool`, optional): If :obj:`True`, the user's current location will be sent when the button is pressed. Available in private chats only. request_poll (:class:`~telegram.KeyboardButtonPollType`, optional): If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. web_app (:class:`~telegram.WebAppInfo`, optional): If specified, the described `Web App `_ will be launched when the button is pressed. The Web App will be able to send a :attr:`Message.web_app_data` service message. Available in private chats only. .. versionadded:: 20.0 request_users (:class:`KeyboardButtonRequestUsers`, optional): If specified, pressing the button will open a list of suitable users. Tapping on any user will send its identifier to the bot in a :attr:`telegram.Message.users_shared` service message. Available in private chats only. .. versionadded:: 20.8 request_chat (:class:`KeyboardButtonRequestChat`, optional): If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a :attr:`telegram.Message.chat_shared` service message. Available in private chats only. .. versionadded:: 20.1 Attributes: text (:obj:`str`): Text of the button. If none of the optional fields are used, it will be sent to the bot as a message when the button is pressed. request_contact (:obj:`bool`): Optional. If :obj:`True`, the user's phone number will be sent as a contact when the button is pressed. Available in private chats only. request_location (:obj:`bool`): Optional. If :obj:`True`, the user's current location will be sent when the button is pressed. Available in private chats only. request_poll (:class:`~telegram.KeyboardButtonPollType`): Optional. If specified, the user will be asked to create a poll and send it to the bot when the button is pressed. Available in private chats only. web_app (:class:`~telegram.WebAppInfo`): Optional. If specified, the described `Web App `_ will be launched when the button is pressed. The Web App will be able to send a :attr:`Message.web_app_data` service message. Available in private chats only. .. versionadded:: 20.0 request_users (:class:`KeyboardButtonRequestUsers`): Optional. If specified, pressing the button will open a list of suitable users. Tapping on any user will send its identifier to the bot in a :attr:`telegram.Message.users_shared` service message. Available in private chats only. .. versionadded:: 20.8 request_chat (:class:`KeyboardButtonRequestChat`): Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a :attr:`telegram.Message.chat_shared` service message. Available in private chats only. .. versionadded:: 20.1 ) request_chatrequest_contactrequest_location request_poll request_userstextweb_appN api_kwargsrrrrrrrrcPt ||||_||_||_||_||_||_||_|j|j|j|j |j |j|jf|_ |jy)Nr) super__init__rrrrrrr _id_attrs_freeze) selfrrrrrrrr __class__s ^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/telegram/_keyboardbutton.pyrzKeyboardButton.__init__s J/ />0@>J-4 CPAM II   ! !    LL        databotr returnc|j|}t|jdt||d<t|jdt||d<t|jdt ||d<t|jdt ||d<i}|jdx}rd|i}t|!|||S)z,See :meth:`telegram.TelegramObject.de_json`.rrrr request_user)r!r"r) _parse_datar getrrrr r_de_json)clsr!r"rr%rs rde_jsonzKeyboardButton.de_jsonst$/ HH^ $& CPY  88N3 3< 3(,7JwTszJJr )NNNNNN)N)__name__ __module__ __qualname____doc__ __slots__strrboolrr rrr r classmethodr* __classcell__)rs@rrr"sXtI+/+/9=(,<@>B"*."""$"#4. " 56 " *% "89" :;"X&"HK8K(5/KEUKKr rN)r.typingrr telegram._keyboardbuttonpolltypertelegram._keyboardbuttonrequestrrtelegram._telegramobjectrtelegram._utils.argumentparsingr telegram._utils.typesr telegram._webappinfor telegramr rr rr=s6&P*Ca3<*+_K^_Kr