From 653e049f2e4a20aee48a6fb0c4a633746ab00591 Mon Sep 17 00:00:00 2001 From: Florian Kellermann Date: Wed, 11 May 2022 09:26:42 +0200 Subject: [PATCH] More markdown proof --- telegram_bot/bot_updates.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/telegram_bot/bot_updates.py b/telegram_bot/bot_updates.py index 01b8543..434ece5 100644 --- a/telegram_bot/bot_updates.py +++ b/telegram_bot/bot_updates.py @@ -148,7 +148,7 @@ def update_for_user(p_user_id, p_my_handler): if len(share_symbols) != 0: for i in range(len(share_symbols)): my_price = share_fetcher.get_share_price_no_currency(share_symbols[i]) - my_update_message = f'{share_fetcher.get_share_information_markdown(share_symbols[i])}\ncount: {share_amounts[i]}\nTotal: {hf.make_markdown_proof(round(float(my_price) * float(share_amounts[i]), 2))} EUR' + my_update_message = f'{share_fetcher.get_share_information_markdown(share_symbols[i])}\ncount: {hf.make_markdown_proof(share_amounts[i])}\nTotal: {hf.make_markdown_proof(round(float(my_price) * float(share_amounts[i]), 2))} EUR' bot.send_message(chat_id=p_user_id, text=my_update_message, parse_mode="MARKDOWNV2") else: send_to_user("No shares found for your account. Check https://gruppe1.testsites.info to change your settings and add shares.", pUser_id=p_user_id) @@ -169,10 +169,10 @@ def update_for_user(p_user_id, p_my_handler): 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) + send_to_user(f"No news found for keyword _{keyword}_\.", pUser_id=p_user_id, md_mode=True) elif news == None: # if news is none - send_to_user(f"Server error for keyword _{keyword}_.", pUser_id=p_user_id, md_mode=True) + send_to_user(f"Server error for keyword _{keyword}_\.", pUser_id=p_user_id, md_mode=True) else: news_formatted = news_fetcher.format_article(news[0]) # format for message, only use the most popular article send_to_user(f"_keyword: {keyword}_\n\n{news_formatted}", pUser_id=p_user_id, md_mode=True) # send news with related keyword in Markdown