As of Telegram's Bot API version 4.5, the API supports a new text format, MarkdownV2
. This is an enhanced version of the previous Markdown support.
The "specification" for MarkdownV2 says:
- Inside
(...)
part of inline link definition, all ')' and '\' must be escaped with a preceding '\' character.- In all other places characters '_', '*', '[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!' must be escaped with the preceding character '\'.
Why does the dot .
character need to be escaped? As far as I can see, it isn't used in any formatting syntax. The syntax examples that Telegram provides certainly doesn't use .
in that way:
To use this mode, pass MarkdownV2 in the parse_mode field. Use the following syntax in your message:
*bold \*text* _italic \*text_ __underline__ ~strikethrough~ *bold _italic bold ~italic bold strikethrough~ __underline italic bold___ bold* [inline URL](http://www.example.com/) [inline mention of a user](tg://user?id=123456789) `inline fixed-width code` ``` pre-formatted fixed-width code block ``` ```python pre-formatted fixed-width code block written in the Python programming language ```