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,