From 1504e03e1363ab7f0017ff6439c7f64eed09ebb2 Mon Sep 17 00:00:00 2001 From: dymik739 Date: Tue, 5 Sep 2023 11:46:59 +0300 Subject: [PATCH] main.py: added temporary fix for MarkdownV2 support --- main.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index b3bcf64..c609e88 100644 --- a/main.py +++ b/main.py @@ -192,11 +192,9 @@ def queue_processor(): if response: # protecting output - response = response.replace("(", "\\(") - response = response.replace(")", "\\)") - response = response.replace("!", "\\!") - response = response.replace(".", "\\.") - response = response.replace("=", "\\=") + symbols_to_escape = ['[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!'] + for symbol in symbols_to_escape: + response = response.replace(symbol, f"\\{symbol}") updater.bot.send_message(chat_id=msg.chat.id, text=response, disable_web_page_preview=True,