skip to Main Content
bot.sendDocument(id, 'test.zip'); 

I have a 1.5GB file. But it is not sent to the user, it gives the following error:

(Unhandled rejection Error: ETELEGRAM: 413 Request Entity Too Large)

I know that the limit is 2GB, but the file is not sent. Tell me what should I do?

I only tried the above code.

2

Answers


  1. I know that the limit is 2GB, but the file is not sent

    The 2 GB is the user limit, Bot’s have an upload limit of 50 MB

    So there is currently no way to exceed that limit using the Bot API.


    From the sendDocument documenetation:

    Use this method to send general files. On success, the sent Message is returned. Bots can currently send files of any type of up to 50 MB in size, this limit may be changed in the future.

    Login or Signup to reply.
  2. Just adding to @0stone0’s answer. Bots have a file upload limit of 50 MB. If you want to bypass that you can run the Telegram Bot API server locally and host your bot over it.

    If you are serving the Bot API server locally, then you’ll unlock a whole lot of new perks like

    • Upload files up to 2000 MB.
    • Download files without size limit

    check the tdlib/telegram-bot-api repo for more info.

    By the way, this is of course, of of context of node-telegram-bot-api.

    Hope this helps 🙂

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