main.py: added temporary fix for MarkdownV2 support
This commit is contained in:
parent
87424c8786
commit
1504e03e13
8
main.py
8
main.py
|
@ -192,11 +192,9 @@ def queue_processor():
|
||||||
|
|
||||||
if response:
|
if response:
|
||||||
# protecting output
|
# protecting output
|
||||||
response = response.replace("(", "\\(")
|
symbols_to_escape = ['[', ']', '(', ')', '~', '`', '>', '#', '+', '-', '=', '|', '{', '}', '.', '!']
|
||||||
response = response.replace(")", "\\)")
|
for symbol in symbols_to_escape:
|
||||||
response = response.replace("!", "\\!")
|
response = response.replace(symbol, f"\\{symbol}")
|
||||||
response = response.replace(".", "\\.")
|
|
||||||
response = response.replace("=", "\\=")
|
|
||||||
|
|
||||||
updater.bot.send_message(chat_id=msg.chat.id, text=response,
|
updater.bot.send_message(chat_id=msg.chat.id, text=response,
|
||||||
disable_web_page_preview=True,
|
disable_web_page_preview=True,
|
||||||
|
|
Loading…
Reference in New Issue