mirror of
https://git.phreedom.club/localhost_frssoft/FMN_bot.git
synced 2024-11-24 23:20:55 +01:00
Limit listening mentions time
This commit is contained in:
parent
6ba859a308
commit
2e45cc987c
|
@ -13,12 +13,16 @@ def get_control_mention():
|
||||||
while True:
|
while True:
|
||||||
time_now = datetime.now()
|
time_now = datetime.now()
|
||||||
now_week = time_now.weekday()
|
now_week = time_now.weekday()
|
||||||
|
now_hour = time_now.hour
|
||||||
if now_week not in (0, 6):
|
if now_week not in (0, 6):
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
continue
|
continue
|
||||||
if get_state('last_thread_id'):
|
if get_state('last_thread_id'):
|
||||||
time.sleep(30)
|
time.sleep(30)
|
||||||
continue
|
continue
|
||||||
|
if now_week == 6 and now_hour <= fmn_next_watching_hour: # Предотвращение работы в холстую до начала сеанса
|
||||||
|
time.sleep(30)
|
||||||
|
continue
|
||||||
logger.debug('Wait for from admin mention...')
|
logger.debug('Wait for from admin mention...')
|
||||||
notif = get_notifications()
|
notif = get_notifications()
|
||||||
for i in notif:
|
for i in notif:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user