async def process_callback_button1(callback_query: types.CallbackQuery):
genre = callback_query.data
random_film = handlers.films(genre)
await bot.answer_callback_query(callback_query.id)
await bot.send_message(callback_query.from_user.id, f"{search}", reply_markup=InlineKeyboardMarkup().add(
InlineKeyboardButton(text=f'{random_film}',
url=f'https://yandex.ru/search/?text={random_film}')))
def films(genre):
with open('films_genre_dict.json', encoding='utf-8') as f:
dict_films = json.load(f)
s = random.choice(dict_films[f'{genre}'])
return f'{s[0]} {s[1]}'
spoilerНа айфоне
spoilerНа андроиде