0
votes

Okay i can send audio with some url in inline mode. But how can i send the local audio from the directory? Telegram Bot API return me this:

A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body: [b'{"ok":false,"error_code":400,"description":"Bad Request: CONTENT_URL_INVALID"}']

1
Guess you can't because telegram doesn't allow uploading files. You could upload your audio on some dedicated service, like soundcloud, or any cloud, and then share the link via telegram. - Loïc
Why doesn't allow? There is sendAudio method that allow upload and send audio via message - Александр Котовский

1 Answers

0
votes

InlineQueryResultAudio only accepts links while InlineQueryResultCachedAudio only accepts file_id. What you can do is post the files to your own server or upload it elsewhere to use the former one, or use SendAudio to get the file_id of it and use the latter one.