Search code examples
pythontelegram-bottelepot

How can I send an audio from url using bot.sendAudio()


I have a telegram bot that you can text a YouTube link and it replys with a link that you can open to download the audio format. I wanted to make it more efficient and instead of sending a link (using bot.sendMessage()) that you can click to download, How can I make the bot send the audio it self from the link using bot.sendAudio()? ... Thanks in advance


Solution

  • Just use URL string instead of file in sendAudio method.

    Note that you can send max 20MB of content.