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

Method reply_copy

src/telegram/_message.py:4273–4355  ·  view source on GitHub ↗

Shortcut for:: await bot.copy_message( chat_id=message.chat.id, message_thread_id=update.effective_message.message_thread_id, message_id=message_id, direct_messages_topic_id=self.direct_messages_topic.topic_id,

(
        self,
        from_chat_id: str | int,
        message_id: int,
        caption: str | None = None,
        parse_mode: ODVInput[str] = DEFAULT_NONE,
        caption_entities: Sequence["MessageEntity"] | None = None,
        disable_notification: ODVInput[bool] = DEFAULT_NONE,
        reply_markup: "ReplyMarkup | None" = None,
        protect_content: ODVInput[bool] = DEFAULT_NONE,
        message_thread_id: ODVInput[int] = DEFAULT_NONE,
        reply_parameters: "ReplyParameters | None" = None,
        show_caption_above_media: bool | None = None,
        allow_paid_broadcast: bool | None = None,
        video_start_timestamp: int | None = None,
        suggested_post_parameters: "SuggestedPostParameters | None" = None,
        message_effect_id: str | None = None,
        *,
        reply_to_message_id: int | None = None,
        allow_sending_without_reply: ODVInput[bool] = DEFAULT_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

4271 )
4272
4273 async def reply_copy(
4274 self,
4275 from_chat_id: str | int,
4276 message_id: int,
4277 caption: str | None = None,
4278 parse_mode: ODVInput[str] = DEFAULT_NONE,
4279 caption_entities: Sequence["MessageEntity"] | None = None,
4280 disable_notification: ODVInput[bool] = DEFAULT_NONE,
4281 reply_markup: "ReplyMarkup | None" = None,
4282 protect_content: ODVInput[bool] = DEFAULT_NONE,
4283 message_thread_id: ODVInput[int] = DEFAULT_NONE,
4284 reply_parameters: "ReplyParameters | None" = None,
4285 show_caption_above_media: bool | None = None,
4286 allow_paid_broadcast: bool | None = None,
4287 video_start_timestamp: int | None = None,
4288 suggested_post_parameters: "SuggestedPostParameters | None" = None,
4289 message_effect_id: str | None = None,
4290 *,
4291 reply_to_message_id: int | None = None,
4292 allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
4293 do_quote: bool | (_ReplyKwargs | None) = None,
4294 read_timeout: ODVInput[float] = DEFAULT_NONE,
4295 write_timeout: ODVInput[float] = DEFAULT_NONE,
4296 connect_timeout: ODVInput[float] = DEFAULT_NONE,
4297 pool_timeout: ODVInput[float] = DEFAULT_NONE,
4298 api_kwargs: JSONDict | None = None,
4299 ) -> "MessageId":
4300 """Shortcut for::
4301
4302 await bot.copy_message(
4303 chat_id=message.chat.id,
4304 message_thread_id=update.effective_message.message_thread_id,
4305 message_id=message_id,
4306 direct_messages_topic_id=self.direct_messages_topic.topic_id,
4307 *args,
4308 **kwargs
4309 )
4310
4311 For the documentation of the arguments, please see :meth:`telegram.Bot.copy_message`.
4312
4313 .. versionchanged:: 21.1
4314 |reply_same_thread|
4315
4316 .. versionchanged:: 22.0
4317 |quote_removed|
4318
4319 Keyword Args:
4320 do_quote (:obj:`bool` | :obj:`dict`, optional): |do_quote|
4321
4322 .. versionadded:: 20.8
4323
4324 Returns:
4325 :class:`telegram.MessageId`: On success, returns the MessageId of the sent message.
4326
4327 """
4328 chat_id, effective_reply_parameters = await self._parse_quote_arguments(
4329 do_quote, reply_to_message_id, reply_parameters, allow_sending_without_reply
4330 )

Callers 1

test_reply_copyMethod · 0.80

Calls 5

get_botMethod · 0.80
copy_messageMethod · 0.45

Tested by 1

test_reply_copyMethod · 0.64