mirror of
https://github.com/python-telegram-bot/python-telegram-bot.git
synced 2024-11-25 08:37:07 +01:00
Updated Code snippets (markdown)
parent
cadc850ee2
commit
6d17274fa1
1 changed files with 1 additions and 1 deletions
|
@ -150,7 +150,7 @@ To catch the incoming message with the location/contact, use `MessageHandler` wi
|
||||||
### Message Formatting (bold, italic, code, ...)
|
### Message Formatting (bold, italic, code, ...)
|
||||||
|
|
||||||
Telegram supports some formatting options for text. All the details about what is supported can be found [here](https://core.telegram.org/bots/api#formatting-options).
|
Telegram supports some formatting options for text. All the details about what is supported can be found [here](https://core.telegram.org/bots/api#formatting-options).
|
||||||
You can format text with every API method/type that has a `parse_mode` parameter. In addition to editing your text as described in the link above, pass one of the parse modes available through [`telegram.ParseMode`](https://python-telegram-bot.readthedocs.io/en/stable/telegram.parsemode.htm ) to the `parse_mode` parameter. Since th `5.0` update of the Bot API (version `13.1+` of PTB), you can alternatively pass a list of [`telegram.MessageEntities`](https://python-telegram-bot.readthedocs.io/en/stable/telegram.messageentity.html) to the `entities` parameter.
|
You can format text with every API method/type that has a `parse_mode` parameter. In addition to editing your text as described in the link above, pass one of the parse modes available through [`telegram.ParseMode`](https://python-telegram-bot.readthedocs.io/en/stable/telegram.parsemode.html) to the `parse_mode` parameter. Since th `5.0` update of the Bot API (version `13.1+` of PTB), you can alternatively pass a list of [`telegram.MessageEntities`](https://python-telegram-bot.readthedocs.io/en/stable/telegram.messageentity.html) to the `entities` parameter.
|
||||||
|
|
||||||
*Note:* In the API 4.5 update, Telegram introduced MarkdownV2, which supports nested entities and needs other escaping than v1. Markdown V1 is referred as legacy mode by the official API docs, and you should prefer MarkdownV2. Make sure to also use `reply_markdown_v2` instead of `reply_markdown` etc.
|
*Note:* In the API 4.5 update, Telegram introduced MarkdownV2, which supports nested entities and needs other escaping than v1. Markdown V1 is referred as legacy mode by the official API docs, and you should prefer MarkdownV2. Make sure to also use `reply_markdown_v2` instead of `reply_markdown` etc.
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue