def get_closest(cls) -> Ether: today = DateTime.day_num() for br in (cls(today, time) for time in others.ETHER_TIMES[today]): if br.is_now() or not br.is_already_play_today(): return br tomorrow = (today + 1) % 7 return cls(tomorrow, 0)
async def order_choose_day() -> InlineKeyboardMarkup: today = DateTime.day_num() btns = [] if (ether_now := Ether.now()) and await Broadcast(ether_now).get_free_time( ) > 3 * 60: # кнопка сейчас если эфир+влазит btns.append(_ikb(NEXT_DAYS[-1], cb.CBOrderTime(today, ether_now.num)))
def is_today(self) -> bool: return self.day == DateTime.day_num()