skip to Main Content

I want to send mp3 file to the user from telethon bot, when I do that with bot.send_file(supports_streaming=True) it arrives with delay like this:
https://i.stack.imgur.com/69oau.png

I also tried bot.upload_file which should upload file on telegram server and return InputFile, but calling bot.send_file(file=input_file) gives the same result.

What I want is to provide instant link to file with download button like this:
https://i.stack.imgur.com/epRQs.png

I’ve seen this in one audio book bot, it gives this download button immediately even for 200MB files. Help me to implement this please.

2

Answers


  1. Chosen as BEST ANSWER

    It seems like telethon doesn't have functionality for this kind of problem yet, but I found super easy solution in aiogram library, it accepts links as well as files which was useful in my case. https://aiogram.2038.io/api/methods/send_audio/


  2. Telethon’s docs for send_file says you can pass supports_streaming=True.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search