A
A
Arthur2020-03-09 23:24:27
Bots
Arthur, 2020-03-09 23:24:27

How to get sticker preview in telegram by file_id?

Good afternoon!

There is a form for sending a message to telegram, in the form you can specify a sticker via file_id, I get file_id itself through the bot, but here's how to convert it back so that when filling out the form when entering file_id, show the sticker that will be sent and potentially send the sticker by preview and without input file_id?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vladislav the Wise, 2020-03-10
@yungtitanium

Like update.message.sticker.file.id?
If yes, then you can write it to a variable and that's it.
Or what do you want?

Z
Zudwa, 2020-03-11
@pembrock

By file_id, through the getFile method, you get a File object that has a file_path .
And then, the sticker itself can be obtained like this:

https://api.telegram.org/file/bot<token>/<file_path>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question