L idZddlmZddlmZmZmZmZddlm Z ddl m Z ddl m Z ddlmZmZddlmZdd lmZdd lmZdd lmZdd lmZmZmZmZerdd lmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&GddeZ'y)zGThis module contains an object that represents a Telegram CallbackQuery)Sequence) TYPE_CHECKINGFinalOptionalUnion) constants)Location)InputChecklist)MaybeInaccessibleMessageMessage)TelegramObject)User)de_json_optional) DEFAULT_NONE)JSONDictODVInput ReplyMarkup TimePeriod) Bot GameHighScoreInlineKeyboardMarkup InputMediaLinkPreviewOptions MessageEntity MessageIdReplyParametersSuggestedPostParametersc,eZdZUdZdZ dVdddedededeed eed eed eed ee ffd Z e dWd e dedddffd Z dVe e e e dddeedeedeedeedeedeedeedeed ee defdZdXdedefdZe dde fde e e e dddedeed ed!d"eed#d$ed%d&eedeedeedeedeed ee deeeffd'Zdde ddfe e e e ddd(eed ed!deed)eed#d*eedeedeedeedeed ee deeeffd+Z dWe e e e ddd,ed ed!deedeedeedeed ee deeeffd-Z dWe e e e ddd ed!deedeedeedeed ee deeeffd.Z dWe e e e ddd/d0d ed!deedeedeedeed ee deeeffd1Z dYde e e e dd2d3eed4eed ed!d5eed6eed7eed8eed9eedeedeedeedeed ee deeeffd:Z dWe e e e ddd ed!deedeedeedeed ee deeeffd;Z dZe e e e dddeed?eedeedeedeedeed ee deeeffd@Z!e e e e dddMYwDc22r1 read_timeout write_timeoutconnect_timeout pool_timeoutr(text show_alerturl cache_timer<r=r>r?c K|jj|j|||||||||  d{S7w)a1Shortcut for:: await bot.answer_callback_query(update.callback_query.id, *args, **kwargs) For the documentation of the arguments, please see :meth:`telegram.Bot.answer_callback_query`. Returns: :obj:`bool`: On success, :obj:`True` is returned. ) callback_query_idr@rArBrCr<r=r>r?r(N)get_botanswer_callback_queryr$) r.r@rArBrCr<r=r>r?r(s r0answerzCallbackQuery.answersR0\\^99"gg!!%'+%!:    s7A>Aactionclt|jtstd|d|jS)zHelper method to get the message for the shortcut methods. Must be called only if :attr:`inline_message_id` is *not* set. zCannot z an inaccessible message) isinstancer&r TypeError)r.rIs r0 _get_messagezCallbackQuery._get_messages1$,,0gfX-EFG G||r1)disable_web_page_previewr<r=r>r?r( parse_mode reply_markuprentitiesrlink_preview_optionsrrNcK|jr@|jj|j|||||||| | | |dddd{S|jj |||||||| | | | d{S767w)aShortcut for either:: await update.callback_query.message.edit_text(*args, **kwargs) or:: await bot.edit_message_text( inline_message_id=update.callback_query.inline_message_id, *args, **kwargs, ) For the documentation of the arguments, please see :meth:`telegram.Bot.edit_message_text` and :meth:`telegram.Message.edit_text`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. N)r%r@rOrNrRrPr<r=r>r?r(rQchat_id message_idbusiness_connection_id) r@rOrNrRrPr<r=r>r?r(rQ)r%rFedit_message_textrM edit_text) r.r@rOrPrQrRrNr<r=r>r?r(s r0rWzCallbackQuery.edit_message_textsN  ! !99"&"8"8%)A%9))+ /)%!'+!: $&&(22!%=!5%%'+%!3   %$  s$AB B 1B<B=BBcaptioncaption_entitiesshow_caption_above_mediac K|jr?|jj||j||||| || |dd|dd{S|jj |||||| || || d{S757w)a%Shortcut for either:: await update.callback_query.message.edit_caption(*args, **kwargs) or:: await bot.edit_message_caption( inline_message_id=update.callback_query.inline_message_id, *args, **kwargs, ) For the documentation of the arguments, please see :meth:`telegram.Bot.edit_message_caption` and :meth:`telegram.Message.edit_caption`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. N)rYr%rPr<r=r>r?rOr(rZrTrUr[rV) rYrPr<r=r>r?rOr(rZr[)r%rFedit_message_captionrM edit_caption) r.rYrPrOrZr[r<r=r>r?r(s r0r]z"CallbackQuery.edit_message_captionsL  ! !<<"&"8"8))+ /)%%!1)A'+= "&&(55%%'+%!!-%=6   #"  s$AB A? 0B:B;BB checklistc jK|jj|||||||d{S7w)aShortcut for:: await update.callback_query.message.edit_checklist(*args, **kwargs) For the documentation of the arguments, please see :meth:`telegram.Message.edit_checklist`. .. versionadded:: 22.3 Returns: :class:`telegram.Message`: On success, the edited Message is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. )r_rPr<r=r>r?r(N)rMedit_checklist)r.r_rPr<r=r>r?r(s r0edit_message_checklistz$CallbackQuery.edit_message_checklist_sH6&&(77%%'+%!8    *313c K|jr;|jj||j|||||ddd d{S|jj ||||||d{S717w)a@Shortcut for either:: await update.callback_query.message.edit_reply_markup(*args, **kwargs) or:: await bot.edit_message_reply_markup( inline_message_id=update.callback_query.inline_message_id, *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.edit_message_reply_markup` and :meth:`telegram.Message.edit_reply_markup`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. N) rPr%r<r=r>r?r(rTrUrVrPr<r=r>r?r()r%rFedit_message_reply_markuprMedit_reply_markupr.rPr<r=r>r?r(s r0rfz'CallbackQuery.edit_message_reply_markupsF  ! !AA)"&"8"8)+ /)%'+B   &&(::%%'+%! ;     $AA;A7,A;2A93A;9A;mediarc K|jr<|jj|j|||||||ddd d{S|jj |||||||d{S727w)a"Shortcut for either:: await update.callback_query.message.edit_media(*args, **kwargs) or:: await bot.edit_message_media( inline_message_id=update.callback_query.inline_message_id, *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.edit_message_media` and :meth:`telegram.Message.edit_media`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :class:`telegram.Message`: On success, if edited message is not an inline message, the edited Message is returned, otherwise :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. N) r%rjrPr<r=r>r?r(rTrUrV)rjrPr<r=r>r?r()r%rFedit_message_mediarM edit_media)r.rjrPr<r=r>r?r(s r0rlz CallbackQuery.edit_message_mediasF  ! !::"&"8"8))+ /)%'+;   &&(33%%'+%!4     s$AA=A9-A=4A;5A=;A=)locationr<r=r>r?r(latitude longitudehorizontal_accuracyheadingproximity_alert_radius live_periodrncK|jrB|jj|j||||| | | | | ||||dddd{S|jj ||||| | | | | |||| d{S787w)aDShortcut for either:: await update.callback_query.message.edit_live_location(*args, **kwargs) or:: await bot.edit_message_live_location( inline_message_id=update.callback_query.inline_message_id, *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.edit_message_live_location` and :meth:`telegram.Message.edit_live_location`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. N)r%rorprnrPr<r=r>r?r(rqrrrsrtrTrUrV) rorprnrPr<r=r>r?r(rqrrrsrt)r%rFedit_message_live_locationrMedit_live_location)r.rorprPrqrrrsrtrnr<r=r>r?r(s r0rvz(CallbackQuery.edit_message_live_locationsT  ! !BB"&"8"8!#!))+ /)%$7'=''+%C (&&(;;%%'+%! 3#9#<   )( s$A B  B 3B BB B c K|jr;|jj|j||||||ddd d{S|jj ||||||d{S717w)aDShortcut for either:: await update.callback_query.message.stop_live_location(*args, **kwargs) or:: await bot.stop_message_live_location( inline_message_id=update.callback_query.inline_message_id, *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.stop_message_live_location` and :meth:`telegram.Message.stop_live_location`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. N) r%rPr<r=r>r?r(rTrUrVre)r%rFstop_message_live_locationrMstop_live_locationrhs r0ryz(CallbackQuery.stop_message_live_locationIsF  ! !BB"&"8"8))+ /)%'+C   &&(;;%%'+%! <     riuser_idscoreforcedisable_edit_messagecK|jr=|jj|j||||||||| dd d{S|jj|||||||||  d{S747w)aShortcut for either:: await update.callback_query.message.set_game_score(*args, **kwargs) or:: await bot.set_game_score( inline_message_id=update.callback_query.inline_message_id, *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.set_game_score` and :meth:`telegram.Message.set_game_score`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :class:`telegram.Message`: On success, if edited message is sent by the bot, the edited Message is returned, otherwise :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. N) r%r{r|r}r~r<r=r>r?r(rTrU) r{r|r}r~r<r=r>r?r()r%rFset_game_scorerM) r.r{r|r}r~r<r=r>r?r(s r0rzCallbackQuery.set_game_scoresJ  ! !66"&"8"8%9)+ /)%7   &&(77!5%'+%!8      s$ABA</B7A>8B>B)r.c K|jr:|jj|j||||||dd d{S|jj||||||d{S717w)aShortcut for either:: await update.callback_query.message.get_game_high_score(*args, **kwargs) or:: await bot.get_game_high_scores( inline_message_id=update.callback_query.inline_message_id, *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Bot.get_game_high_scores` and :meth:`telegram.Message.get_game_high_scores`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: tuple[:class:`telegram.GameHighScore`] Raises: :exc:`TypeError` if :attr:`message` is not accessible. N) r%r{r<r=r>r?r(rTrU)r{r<r=r>r?r()r%rFget_game_high_scoresrM)r.r{r<r=r>r?r(s r0rz"CallbackQuery.get_game_high_scoressD  ! !<<"&"8"8)+ /)%=   &&(==%'+%! >     s$AA:A6,A:1A82A:8A:cjK|jdj|||||d{S7w)aShortcut for:: await update.callback_query.message.delete(*args, **kwargs) For the documentation of the arguments, please see :meth:`telegram.Message.delete`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :obj:`bool`: On success, :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. deleterIr;N)rMrr.r<r=r>r?r(s r0delete_messagezCallbackQuery.delete_messagesG2&&h&7>>%'+%! ?    rcdisable_notificationclK|jdj||||||d{S7w)aShortcut for:: await update.callback_query.message.pin(*args, **kwargs) For the documentation of the arguments, please see :meth:`telegram.Message.pin`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :obj:`bool`: On success, :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. pinr)rr<r=r>r?r(N)rMr)r.rr<r=r>r?r(s r0 pin_messagezCallbackQuery.pin_messagesJ2&&e&488!5%'+%! 9    s +424cjK|jdj|||||d{S7w)aShortcut for:: await update.callback_query.message.unpin(*args, **kwargs) For the documentation of the arguments, please see :meth:`telegram.Message.unpin`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :obj:`bool`: On success, :obj:`True` is returned. Raises: :exc:`TypeError` if :attr:`message` is not accessible. unpinrr;N)rMrrs r0 unpin_messagezCallbackQuery.unpin_message=sG0&&g&6<<%'+%! =    rc)allow_sending_without_replyreply_to_message_idr<r=r>r?r(rTprotect_contentmessage_thread_idreply_parametersrallow_paid_broadcastvideo_start_timestampsuggested_post_parametersrrrrcK|jdj|||| ||||||||||||| | | | d{S7w)aShortcut for:: await update.callback_query.message.copy( from_chat_id=update.message.chat_id, message_id=update.message.message_id, direct_messages_topic_id=update.message.direct_messages_topic.topic_id, *args, **kwargs ) For the documentation of the arguments, please see :meth:`telegram.Message.copy`. .. versionchanged:: 20.8 Raises :exc:`TypeError` if :attr:`message` is not accessible. Returns: :class:`telegram.MessageId`: On success, returns the MessageId of the sent message. Raises: :exc:`TypeError` if :attr:`message` is not accessible. copyr)rTrYrOrrZrrrrPr<r=r>r?r(rrrr[rrN)rMr)r.rTrYrOrZrrPrrrr[rrrrrr<r=r>r?r(s r0 copy_messagezCallbackQuery.copy_message]suZ&&f&5::!"7-!5 3(C%%'+%!+/-%=!5&?);    s9AAAMAX_ANSWER_TEXT_LENGTH)NNNN)N)edit)NNNNNNN)NN)0__name__ __module__ __qualname____doc__ __slots__strrrr rr+ classmethodr9rboolrrfloatrHr rMrrrWr]r rbrfrlintr rvryrtuplerrrrrrrCallbackQueryLimit!ANSWER_CALLBACK_QUERY_TEXT_LENGTHrr__annotations__ __classcell__)r/s@r0rr1s BHI7;"+/)-*.   23  sm $C="#X&6383(5/3_33#%)!+/ # )5)5+7(4)-# sm# TN# c] # Z( # uo#  # "%# uo# X&#  # J3G%19=8# )5)5+7(4)-# !# 56# uo #   # "%# uo# X&#  w} # N:>8 )5)5+7(4)-8 568 uo 8   8 "% 8 uo8 X&8  w} 8 z:>: )5)5+7(4)-: : 56: uo :   : "%: uo: X&:  w} : |%)%)9=/3!%04,0M (,(4)5+7(4)-M 5/M E?M 56 M &e_ M # M !) M j)M 8$M uoM  M "%M uoM X&M w} !M b:>8 )5)5+7(4)-8 568 uo 8   8 "% 8 uo8 X&8  w} 8 |!%/3 > )5)5+7(4)-> > > ~ > 'tn > uo>  > "%> uo> X&>  w} > H)5)5+7(4)-5 5 uo 5   5 "% 5 uo5 X&5  # $5 t)5)5+7(4)- uo    "%  uo  X&   F0<  )5)5+7(4)-  &tn  uo     "%  uo  X&     J)5)5+7(4)- uo    "%  uo  X&   F"&$0@D/;.2*6+/8<37/3/3IMB 7C-1(4)5+7(4)--B sCxB #B SM B #8O#<= B 'tn B {+B "$B $C=B ##45B #+4.B 'tnB  (}B $,,E#FB &.d^!B "&c]#B $uo%B & 'B ("%)B *uo+B ,X&-B . /B J $$FFE#Jr1rN)(rcollections.abcrtypingrrrrtelegramrtelegram._files.locationr telegram._inputchecklistr telegram._messager r telegram._telegramobjectr telegram._userrtelegram._utils.argumentparsingrtelegram._utils.defaultvaluertelegram._utils.typesrrrrrrrrrrrrrrr1r0rsR(N$88-3?3<5MM   w Nw r1