MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / reply_document

Method reply_document

src/telegram/_message.py:2888–2971  ·  view source on GitHub ↗

Shortcut for:: await bot.send_document( update.effective_message.chat_id, message_thread_id=update.effective_message.message_thread_id, business_connection_id=self.business_connection_id, direct_messages_topic_id=self.

(
        self,
        document: "FileInput | Document",
        caption: str | None = None,
        disable_notification: ODVInput[bool] = DEFAULT_NONE,
        reply_markup: "ReplyMarkup | None" = None,
        parse_mode: ODVInput[str] = DEFAULT_NONE,
        disable_content_type_detection: bool | None = None,
        caption_entities: Sequence["MessageEntity"] | None = None,
        protect_content: ODVInput[bool] = DEFAULT_NONE,
        message_thread_id: ODVInput[int] = DEFAULT_NONE,
        thumbnail: "FileInput | None" = None,
        reply_parameters: "ReplyParameters | None" = None,
        message_effect_id: str | None = None,
        allow_paid_broadcast: bool | None = None,
        suggested_post_parameters: "SuggestedPostParameters | None" = None,
        *,
        reply_to_message_id: int | None = None,
        allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
        filename: str | None = None,
        do_quote: bool | (_ReplyKwargs | None) = None,
        read_timeout: ODVInput[float] = DEFAULT_NONE,
        write_timeout: ODVInput[float] = DEFAULT_NONE,
        connect_timeout: ODVInput[float] = DEFAULT_NONE,
        pool_timeout: ODVInput[float] = DEFAULT_NONE,
        api_kwargs: JSONDict | None = None,
    )

Source from the content-addressed store, hash-verified

2886 )
2887
2888 async def reply_document(
2889 self,
2890 document: "FileInput | Document",
2891 caption: str | None = None,
2892 disable_notification: ODVInput[bool] = DEFAULT_NONE,
2893 reply_markup: "ReplyMarkup | None" = None,
2894 parse_mode: ODVInput[str] = DEFAULT_NONE,
2895 disable_content_type_detection: bool | None = None,
2896 caption_entities: Sequence["MessageEntity"] | None = None,
2897 protect_content: ODVInput[bool] = DEFAULT_NONE,
2898 message_thread_id: ODVInput[int] = DEFAULT_NONE,
2899 thumbnail: "FileInput | None" = None,
2900 reply_parameters: "ReplyParameters | None" = None,
2901 message_effect_id: str | None = None,
2902 allow_paid_broadcast: bool | None = None,
2903 suggested_post_parameters: "SuggestedPostParameters | None" = None,
2904 *,
2905 reply_to_message_id: int | None = None,
2906 allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
2907 filename: str | None = None,
2908 do_quote: bool | (_ReplyKwargs | None) = None,
2909 read_timeout: ODVInput[float] = DEFAULT_NONE,
2910 write_timeout: ODVInput[float] = DEFAULT_NONE,
2911 connect_timeout: ODVInput[float] = DEFAULT_NONE,
2912 pool_timeout: ODVInput[float] = DEFAULT_NONE,
2913 api_kwargs: JSONDict | None = None,
2914 ) -> "Message":
2915 """Shortcut for::
2916
2917 await bot.send_document(
2918 update.effective_message.chat_id,
2919 message_thread_id=update.effective_message.message_thread_id,
2920 business_connection_id=self.business_connection_id,
2921 direct_messages_topic_id=self.direct_messages_topic.topic_id,
2922 *args,
2923 **kwargs,
2924 )
2925
2926 For the documentation of the arguments, please see :meth:`telegram.Bot.send_document`.
2927
2928 .. versionchanged:: 21.1
2929 |reply_same_thread|
2930
2931 .. versionchanged:: 22.0
2932 |quote_removed|
2933
2934 Keyword Args:
2935 do_quote (:obj:`bool` | :obj:`dict`, optional): |do_quote|
2936
2937 .. versionadded:: 20.8
2938
2939 Returns:
2940 :class:`telegram.Message`: On success, instance representing the message posted.
2941
2942 """
2943 chat_id, effective_reply_parameters = await self._parse_quote_arguments(
2944 do_quote, reply_to_message_id, reply_parameters, allow_sending_without_reply
2945 )

Callers 1

test_reply_documentMethod · 0.80

Calls 5

get_botMethod · 0.80
send_documentMethod · 0.45

Tested by 1

test_reply_documentMethod · 0.64