M
M
Mr. Podman2018-11-09 15:54:18
Telegram
Mr. Podman, 2018-11-09 15:54:18

How to send an audio file with an attached thumbnail to Telegram?

I'm trying to send an audio file with a thumbnail attached, sendAudio method, thumb parameter .
Everything is successfully delivered to the server, all additional audio parameters are displayed correctly (caption, duration, performer, title) but the thumbnail itself is not displayed in any way. About the limit on the file size and the height-width of the picture in the course, I tried different ones - it is not displayed.
Example:

curl -i -F 'chat_id=<some_id>' \
    -F '[email protected];type=audio/mpeg' \
    -F 'caption=Caption' \
    -F 'duration=100' \
    -F 'performer=Performer' \
    -F 'title=Title' \
    -F '[email protected];type=image/jpeg' \
    'https://api.telegram.org/bot<my_token>/sendAudio'

Has anyone come across what could be wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr. Podman, 2018-12-20
@azay

I will answer myself. The example above actually works.
In the mobile client, the picture is displayed only in the built-in player, as an "icon" of the file.
When choosing a picture, you should also take into account the fact that all the icons in the Telegram are rounded, so square pictures may not look very good.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question