Answer the question
In order to leave comments, you need to log in
How to refer to a function element without its interaction?
@dp.message_handler()
async def search_for_film(message: types.Message) -> None:
await send_result(message)
async def send_result() -> None:
response = api_client.films.send_search_by_keyword_request(SearchByKeywordRequest(message.text))
id = response.films[0].film_id
response = api_client.films.send_film_request(FilmRequest(id))
fx = \
f"*{response.film.name_ru}* ({response.film.year})\n" \
f"Рейтинг: *{response.film.rating_kinopoisk}*⭐\n\n" \
f"{response.film.short_description}"
await bot.send_photo(message.chat.id, response.film.poster_url, fx, reply_markup=kb.inline_kb_full,
parse_mode=types.ParseMode.MARKDOWN)
@dp.callback_query_handler(lambda c: c.data == 'fulldscr')
async def show(callback_query: types.CallbackQuery):
await bot.send_message(callback_query.from_user.id, response.film.description)
@dp.callback_query_handler(lambda c: c.data == 'fulldscr')
async def show(callback_query: types.CallbackQuery):
await bot.send_message(callback_query.from_user.id, response.film.description)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question