From d5c245856b56f863896a16b66aed2eaf4ab75a2b Mon Sep 17 00:00:00 2001 From: Linus E <75929322+Rripped@users.noreply.github.com> Date: Tue, 10 May 2022 18:45:51 +0200 Subject: [PATCH] md mode update --- telegram_bot/bot_updates.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/telegram_bot/bot_updates.py b/telegram_bot/bot_updates.py index c532cef..f524d43 100644 --- a/telegram_bot/bot_updates.py +++ b/telegram_bot/bot_updates.py @@ -15,6 +15,7 @@ import sys from apscheduler.schedulers.background import BackgroundScheduler from api_handling.api_handler import API_Handler import shares.share_fetcher as share_fetcher +import helper_functions as hf ''' @@ -165,6 +166,7 @@ def update_for_user(p_user_id, p_my_handler): send_to_user("If you haven't read yet: \nHere are some interesting news according to your keywords:", pUser_id=p_user_id) for keyword in keywords: news = news_fetcher.get_top_news_by_keyword(keyword)["articles"] + keyword = hf.make_markdown_proof(keyword) if not news: # if empty news array send_to_user(f"No news found for keyword _{keyword}_.", pUser_id=p_user_id, md_mode=True) @@ -194,7 +196,7 @@ def send_to_user(pText, pUser_id , md_mode = False): :rtype: none """ if md_mode: - bot.send_message(chat_id=pUser_id, text=pText, parse_mode="MARKDOWN") + bot.send_message(chat_id=pUser_id, text=pText, parse_mode="MARKDOWNV2") else: bot.send_message(chat_id=pUser_id, text=pText)