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)))
async def playlist_now(message: types.Message): ether = Ether.now() if not ether: print(Ether.ALL) return await message.answer(texts.PLAYLIST_NOW_NOTHING, reply_markup=kb.WHAT_PLAYING) playback = [ str(i) if i else r'¯\_(ツ)_/¯' for i in await Broadcast(ether).get_playback() ] await message.answer(texts.PLAYLIST_NOW.format(*playback), reply_markup=kb.WHAT_PLAYING)
async def orders_queue_empty(): await Broadcast(Ether.now()).play()
async def track_begin(track: PlaylistItem): if not (ether := Ether.now()): return
async def next_track(message: types.Message): await Broadcast.player.next_track() await asyncio.sleep(0.2) prev, now, _ = await Broadcast(Ether.now()).get_playback() await message.answer(f'<i>{prev} ➡ {now}</i>')
async def playlist_next(query: types.CallbackQuery): if not (ether := Ether.now()): return await query.message.answer( texts.CHOOSE_DAY, reply_markup=kb.playlist_choose_day())