tdlight-team/tdlight-telegram-bot-api

"No file limit" not work

Morb0 opened this issue · 2 comments

Morb0 commented

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

#55 fixed this?