From 2e45cc987c624e8363c1841344c7df7041e40e92 Mon Sep 17 00:00:00 2001 From: localhost_frssoft Date: Sun, 11 Sep 2022 00:58:44 +0300 Subject: [PATCH] Limit listening mentions time --- src/listener_mention.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/listener_mention.py b/src/listener_mention.py index f41ac04..7f382b8 100644 --- a/src/listener_mention.py +++ b/src/listener_mention.py @@ -13,12 +13,16 @@ def get_control_mention(): while True: time_now = datetime.now() now_week = time_now.weekday() + now_hour = time_now.hour if now_week not in (0, 6): time.sleep(30) continue if get_state('last_thread_id'): time.sleep(30) continue + if now_week == 6 and now_hour <= fmn_next_watching_hour: # Предотвращение работы в холстую до начала сеанса + time.sleep(30) + continue logger.debug('Wait for from admin mention...') notif = get_notifications() for i in notif: