From 0370dddffd34e1675549bfb8338a3d65037df885 Mon Sep 17 00:00:00 2001 From: Bibo-Joshi <22366557+Bibo-Joshi@users.noreply.github.com> Date: Fri, 30 Dec 2022 22:29:28 +0100 Subject: [PATCH] Updated Code snippets (markdown) --- Code-snippets.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Code-snippets.md b/Code-snippets.md index 7d709e9..b98b153 100644 --- a/Code-snippets.md +++ b/Code-snippets.md @@ -87,7 +87,7 @@ await bot.send_message(chat_id=chat_id, text="I'm sorry Dave I'm afraid I can't --- #### Reply to a message -This is a shortcut to `bot.send_message` with same defaults. Read more about it [in the docs](https://docs.python-telegram-bot.org/en/latest/telegram.message.html#telegram.Message.reply_text). +This is a shortcut to `bot.send_message` with same defaults. Read more about it [in the docs](https://docs.python-telegram-bot.org/telegram.message.html#telegram.Message.reply_text). ```python await update.message.reply_text("I'm sorry Dave I'm afraid I can't do that.") @@ -123,7 +123,7 @@ To catch the incoming message with the location/contact, use `MessageHandler` wi --- ### 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). Please keep in mind that you will have to escape the special characters as detailed in the documentation. PTB also offers a [helper function](https://docs.python-telegram-bot.org/en/latest/telegram.helpers.html#telegram.helpers.escape_markdown) for escaping of Markdown text. For escaping of HTML text, you can use [`html.escape`](https://docs.python.org/3/library/html.html?#html.escape) from the standard library. +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). Please keep in mind that you will have to escape the special characters as detailed in the documentation. PTB also offers a [helper function](https://docs.python-telegram-bot.org/telegram.helpers.html#telegram.helpers.escape_markdown) for escaping of Markdown text. For escaping of HTML text, you can use [`html.escape`](https://docs.python.org/3/library/html.html?#html.escape) from the standard library. 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.constants.ParseMode`](https://python-telegram-bot.readthedocs.io/telegram.constants.html#telegram.constants.ParseMode) to the `parse_mode` parameter. Since the `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/telegram.messageentity.html) to the `entities` parameter. @@ -537,7 +537,7 @@ You can use the `header_buttons` and `footer_buttons` lists to put buttons in th ![Output](http://i.imgur.com/susvvR7.png) -Replace the `...` in below snippet by an appropriate argument, as indicated in the [InlineKeyboardButton documentation](https://python-telegram-bot.readthedocs.io/en/latest/telegram.inlinekeyboardbutton.html). If you want to use `KeyboardButtons`, use `ReplyKeyboardMarkup` instead of `InlineKeyboardMarkup`. +Replace the `...` in below snippet by an appropriate argument, as indicated in the [InlineKeyboardButton documentation](https:/docs.python-telegram-bot.org/telegram.inlinekeyboardbutton.html). If you want to use `KeyboardButtons`, use `ReplyKeyboardMarkup` instead of `InlineKeyboardMarkup`. ```python button_list = [