From 2961bbb4294b603c694edd0bf0ec74661641b833 Mon Sep 17 00:00:00 2001 From: Florian Kellermann Date: Wed, 16 Mar 2022 17:49:57 +0100 Subject: [PATCH] Welcome message for updates and change in json --- telegram_bot/bot.py | 3 +++ telegram_bot/shares/shares_example.json | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/telegram_bot/bot.py b/telegram_bot/bot.py index 5705326..e3e4f28 100644 --- a/telegram_bot/bot.py +++ b/telegram_bot/bot.py @@ -169,6 +169,9 @@ def send_update(message): with open(json_path) as json_file: json_share_data = json.load(json_file) int_share_count = int(json_share_data['share_count']) + str_username = str(json_share_data['user']) + bot.send_message(chat_id=user_id, text=f'Hello {str_username}. Here is the update on your currently owned shares:') + for i in range(int_share_count): diff --git a/telegram_bot/shares/shares_example.json b/telegram_bot/shares/shares_example.json index 79e3273..3b3b2fc 100644 --- a/telegram_bot/shares/shares_example.json +++ b/telegram_bot/shares/shares_example.json @@ -1,5 +1,5 @@ { - "user": "NormalParameter", + "user": "FloKell", "share_count": 2, "shares": [ {