Answer the question
In order to leave comments, you need to log in
How to send music via bot.send_audio (telebot, python)?
There is the following audio data:
{
'id': 456392508,
'owner_id': 371745457,
'track_covers': [
'https://sun1-25.userapi.com/impf/c857724/v857724105/231c49/Z06CcVsa0Pg.jpg?size=80x80&quality=96&sign=64c53cc0a18fbc45a1d34ee0539e8459&type=audio',
'https://sun1-25.userapi.com/impf/c857724/v857724105/231c49/Z06CcVsa0Pg.jpg?size=150x150&quality=96&sign=3e4c5b4d5d8f3e0e876b78af0ec75316&type=audio'
],
'url': 'https://cs1-65v4.vkuseraudio.net/p4/e3d1633c928938.mp3?extra=UwZawvd-y72N_CZYKP_lO04smUYKNGu3zxoXpl2drPQrkQ_PQpmg1ZsnEiMuElrCudU3abDH4V95MNh3aCNhU067lyStRejERVIJIJRQYUCRtA1KIL6q8hOK1Gtp1shMJhCNrCtovzc-IAENvvhsoNAp&long_chunk=1',
'artist': 'Каспийский Груз',
'title': 'Ок',
'duration': 155
}
bot.send_audio(chat_id, audio.get('url'), audio.get('title') + ' - ' + audio.get('artist'))
Answer the question
In order to leave comments, you need to log in
Are you using pyTelegramBotAPI ? If you look at the github of the project, you can find an interesting comment in one of the issue :
You can't set title and performer when you are sending audio by url, but there would be no problem if you will do the same with local file
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question