예제 #1
0
def work_hours(message: Message):
    now = datetime.now(tz).time()
    get = settings.get_timelimits()
    morning = get[0]
    night = get[1]
    morning = datetime.strptime(morning, '%H:%M').time()
    night = datetime.strptime(night, '%H:%M').time()
    notify = settings.get_timenotify()
    if now > morning and now < night:
        catalog(message)
    else:
        bot.send_message(message.chat.id, notify)
예제 #2
0
 def fill_from_settings(self):
     times = settings.get_timelimits()
     notify = settings.get_timenotify()
     self.notification.data = notify
     self.start.data = times[0]
     self.end.data = times[1]