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

Method reply_markdown_v2

src/telegram/_message.py:2390–2470  ·  view source on GitHub ↗

Shortcut for:: await bot.send_message( update.effective_message.chat_id, message_thread_id=update.effective_message.message_thread_id, parse_mode=ParseMode.MARKDOWN_V2, direct_messages_topic_id=self.direct_messages_topic.to

(
        self,
        text: str,
        disable_notification: ODVInput[bool] = DEFAULT_NONE,
        reply_markup: "ReplyMarkup | None" = None,
        entities: Sequence["MessageEntity"] | None = None,
        protect_content: ODVInput[bool] = DEFAULT_NONE,
        message_thread_id: ODVInput[int] = DEFAULT_NONE,
        link_preview_options: ODVInput["LinkPreviewOptions"] = DEFAULT_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,
        disable_web_page_preview: bool | 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

2388 )
2389
2390 async def reply_markdown_v2(
2391 self,
2392 text: str,
2393 disable_notification: ODVInput[bool] = DEFAULT_NONE,
2394 reply_markup: "ReplyMarkup | None" = None,
2395 entities: Sequence["MessageEntity"] | None = None,
2396 protect_content: ODVInput[bool] = DEFAULT_NONE,
2397 message_thread_id: ODVInput[int] = DEFAULT_NONE,
2398 link_preview_options: ODVInput["LinkPreviewOptions"] = DEFAULT_NONE,
2399 reply_parameters: "ReplyParameters | None" = None,
2400 message_effect_id: str | None = None,
2401 allow_paid_broadcast: bool | None = None,
2402 suggested_post_parameters: "SuggestedPostParameters | None" = None,
2403 *,
2404 reply_to_message_id: int | None = None,
2405 allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
2406 disable_web_page_preview: bool | None = None,
2407 do_quote: bool | (_ReplyKwargs | None) = None,
2408 read_timeout: ODVInput[float] = DEFAULT_NONE,
2409 write_timeout: ODVInput[float] = DEFAULT_NONE,
2410 connect_timeout: ODVInput[float] = DEFAULT_NONE,
2411 pool_timeout: ODVInput[float] = DEFAULT_NONE,
2412 api_kwargs: JSONDict | None = None,
2413 ) -> "Message":
2414 """Shortcut for::
2415
2416 await bot.send_message(
2417 update.effective_message.chat_id,
2418 message_thread_id=update.effective_message.message_thread_id,
2419 parse_mode=ParseMode.MARKDOWN_V2,
2420 direct_messages_topic_id=self.direct_messages_topic.topic_id,
2421 business_connection_id=self.business_connection_id,
2422 *args,
2423 **kwargs,
2424 )
2425
2426 Sends a message with markdown version 2 formatting.
2427
2428 For the documentation of the arguments, please see :meth:`telegram.Bot.send_message`.
2429
2430 .. versionchanged:: 21.1
2431 |reply_same_thread|
2432
2433 .. versionchanged:: 22.0
2434 |quote_removed|
2435
2436 Keyword Args:
2437 do_quote (:obj:`bool` | :obj:`dict`, optional): |do_quote|
2438
2439 .. versionadded:: 20.8
2440
2441 Returns:
2442 :class:`telegram.Message`: On success, instance representing the message posted.
2443 """
2444 chat_id, effective_reply_parameters = await self._parse_quote_arguments(
2445 do_quote, reply_to_message_id, reply_parameters, allow_sending_without_reply
2446 )
2447 message_thread_id = self._parse_message_thread_id(chat_id, message_thread_id)

Callers 1

Calls 5

get_botMethod · 0.80
send_messageMethod · 0.45

Tested by 1