tdlight-team / tdlight-telegram-bot-api

The TDLight Telegram Bot API is an actively enhanced fork of the original Bot API, featuring experimental user support, proxies, unlimited files size, and more.
https://t.me/TDLight
Boost Software License 1.0
128 stars 27 forks source link

"No file limit" not work #52

Closed Morb0 closed 11 months ago

Morb0 commented 3 years ago

Hey, I'm setup local api with docker tdlight/tdlightbotapi:latest and set TELEGRAM_NO_FILE_LIMIT env variable. But then I try to call getFile in User Mode i getting "Bad Request: file is too big" anyway. With TELEGRAM_LOCAL that work as expected.

I check condition code from merge request and seem here logical miss:

localMode = false // parameters_->local_mode_
noFileLimit = true // parameters_->no_file_limit_

isBigFile = true // td::max(file->expected_size_, file->local_->downloaded_size_) > MAX_DOWNLOAD_FILE_SIZE

isLimited = (!localMode || !noFileLimit) && isBigFile;

isLimited // -> true

Original

Expected:

localMode = false // parameters_->local_mode_
noFileLimit = true // parameters_->no_file_limit_

isBigFile = true // td::max(file->expected_size_, file->local_->downloaded_size_) > MAX_DOWNLOAD_FILE_SIZE

isLimited = (!localMode && !noFileLimit) && isBigFile;

isLimited // -> false
smaznet commented 3 years ago

55 fixed this?

Morb0 commented 3 years ago

No, I don't think so, this bug is related to these changes. https://github.com/tdlight-team/tdlight-telegram-bot-api/pull/3/files#diff-74cc224c4335e3aa00be82752a64da6c17519d8c66cbc577321fdc5bd41ca269