H
H
Hachiman Hikigaya2021-09-24 14:14:44
Python
Hachiman Hikigaya, 2021-09-24 14:14:44

Telegram bot is it possible to insert the url taken from file_id into the thumb?

@dp.inline_handler()
async def inline(query: types.InlineQuery):
    file = await bot.get_file("AAMCBAADGQEAAhIZYU2ZZjILG8Ra40Ibt3MKfY1sxaYAAtsAA2aa2yqd_AABhIsqdFgBAAdtAAMhBA")
    link = f"https://api.telegram.org/file/bot{API_TOKEN}/{file.file_path}"
    res = [types.InlineQueryResultArticle(id=0, title="test", thumb_url=link
                                          , input_message_content=tt)]
    await query.answer(results=res, cache_time=0, switch_pm_parameter="pp")

614db3a248af5436445953.png
Kr4 tried to do so, but there is no image. If you try to send a photo in a cart with the same link, you will get an error that the url is somehow unusual.
Please tell me what to do or advise a site where I can upload images through a bot and get their url so that I can already transfer it to thumb

Answer the question

In order to leave comments, you need to log in

1 answer(s)
H
Hachiman Hikigaya, 2021-10-14
@var4yn_nik

All answered and done

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question