Repository navigation
Replies: 1 comment
|
The problem is in how you pass the file, not the 300 MB size itself — with a local Bot API server, sending files of up to 2000 MB is supported, so 300 MB is within the limit. In your code you pass With from pathlib import Path
await context.bot.send_document(
chat_id=ADMIN_ID,
document=Path('/absolute/path/to/test.zip'),
)Two conditions for this to work: use an absolute path, and make sure that path is readable by the |
Uh oh!
There was an error while loading. Please reload this page.
I can't figure out how to send large files.
I installed a local server and connected to it. The bot code is attached below.
TBA server startup parameters:
telegram-bot-api --http-port 8081 --dir=/var/lib/telegram-bot-api --temp-dir=/tmp/telegram-bot-api --username=telegram-bot-api --groupname=telegram-bot-api --localI change the ./test.zip file for testing
If it is within (plus or minus) 100 megabytes. Then it loads normally, without errors. If the size is more than 100, then errors of this type begin:
telegram.error.TimedOut: Timed outBut the file still loads.
If the file size is about 300 or more, then the same errors are displayed several times, then they stop and the file does not load.
Please clarify, give an example of a bot that correctly sends large files.
All reactions