From 77f2ee72dfa6e698e112f9b385cd24fef71bb242 Mon Sep 17 00:00:00 2001 From: Administrator Date: Sun, 30 Oct 2022 20:29:23 +0300 Subject: [PATCH] get link --- daemons/notify.py | 2 +- helpers/ruz.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/daemons/notify.py b/daemons/notify.py index 56ef13c..07e71c2 100644 --- a/daemons/notify.py +++ b/daemons/notify.py @@ -24,7 +24,7 @@ def process(): ans += f"🏢 {lesson['building']}, {lesson['auditorium']}\n" ans += f"🕑 {lesson['begin'].strftime('%H:%M')} - {lesson['end'].strftime('%H:%M')}\n" ans += f"🧑‍🏫 {(lesson['lecturer'] or 'Неизвестно')}\n" - if lesson['link']: + if lesson.get('link', None): ans += f"🔗 {lesson['link']}" try: bot.send_message( diff --git a/helpers/ruz.py b/helpers/ruz.py index d411eb2..068dd42 100644 --- a/helpers/ruz.py +++ b/helpers/ruz.py @@ -78,7 +78,7 @@ class RUZ: ans += f"🏢 {lesson['building']}, {lesson['auditorium']}\n" ans += f"🕑 {lesson['begin'].strftime('%H:%M')} - {lesson['end'].strftime('%H:%M')}\n" ans += f"👨‍🏫 {(lesson['lecturer'] or 'Неизвестно')}\n" - if lesson['link']: + if lesson.get('link', None): ans += f"🔗 {lesson['link']}\n" ans += "\n" return ans