diff options
Diffstat (limited to 'hommaexceli_py/telegram_client.py')
| -rw-r--r-- | hommaexceli_py/telegram_client.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/hommaexceli_py/telegram_client.py b/hommaexceli_py/telegram_client.py index d11d876..a0f2af8 100644 --- a/hommaexceli_py/telegram_client.py +++ b/hommaexceli_py/telegram_client.py @@ -17,7 +17,11 @@ from functools import partial chats_mem_cache = set() -ALLOWED_USER_IDS = map(lambda id: int(id), getenv("TELEGRAM_USER_IDS", "").split(",")) + + +ALLOWED_USER_IDS = [ + int(id) for id in getenv("TELEGRAM_USER_IDS", "").split(",") if len(id) > 0 +] def _signal_handler(sig, frame): @@ -42,7 +46,7 @@ def _callback_alarm(context: CallbackContext, sheets_service: Resource): logging.info(f"Sending sheet data to chat id {chat_id}...") if len(this_weeks_rows) > 0: message = "Tällä viikolla tehtävät hommat:\n" + "\n".join( - map(lambda task: f"{task.name} ({task.interval})", this_weeks_rows) + f"{task.name} ({task.interval})" for task in this_weeks_rows ) else: message = "Tällä viikolla ei toistuvia hommia! 🎉 " |
