irazasyed / telegram-bot-sdk

🤖 Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.
https://telegram-bot-sdk.com
BSD 3-Clause "New" or "Revised" License
3.04k stars 671 forks source link

Bad Request: file is too big #1129

Open bobper opened 5 months ago

bobper commented 5 months ago

PHP version

8.2

irazasyed/telegram-bot-sdk version

latest

Laravel version (if any)

11

Code To Reproduce the bug

code

$file = $this->telegram->getFile(['file_id' => $fileId]);

get this error

message: "Bad Request: file is too big"

code: 400

file: "/var/www/html/vendor/irazasyed/telegram-bot-sdk/src/Exceptions/TelegramResponseException.php"

line: 59

i find this issue but i can not set this data

telegram-bot-api --local --api-id=12345 --api-hash=[my hash id]

Even I execute telegram-bot-api with this command I've got this error.

how to set --local>?>?

Error stacktrace (if any)

Telegram\Bot\Exceptions\TelegramResponseException {#545 ▼ // routes/web.php:19

message: "Bad Request: file is too big"

code: 400

file: "/var/www/html/vendor/irazasyed/telegram-bot-sdk/src/Exceptions/TelegramResponseException.php"

line: 59

-previous: Telegram\Bot\Exceptions\TelegramOtherException {#546 ▶} -responseData: array:3 [▶] -response: Telegram\Bot\TelegramResponse {#559 ▼ -httpStatusCode: 400 -headers: array:8 [▶] -body: "{"ok":false,"error_code":400,"description":"Bad Request: file is too big"}" -decodedBody: array:3 [▶] -endPoint: "getFile" -thrownException: Telegram\Bot\Exceptions\TelegramResponseException {#545} -request: Telegram\Bot\TelegramRequest {#528 ▼ -accessToken: "550557969:AAGVWfOd4saRQxpYHTio7WkyywWrLH4BHnI" -method: "GET" -endpoint: "getFile" -headers: [] -params: array:1 [▶] -isAsyncRequest: false -timeOut: 60 -connectTimeOut: 10 } } trace: {▼ /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/Exceptions/TelegramResponseException.php:59 {▶} /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/TelegramResponse.php:96 {▶} /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/TelegramResponse.php:79 {▶} /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/TelegramResponse.php:49 {▶} /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/TelegramClient.php:122 {▶} /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/TelegramClient.php:50 {▶} /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/Traits/Http.php:152 {▶} /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/Traits/Http.php:128 {▶} /var/www/html/vendor/irazasyed/telegram-bot-sdk/src/Methods/Get.php:76 {▶} /var/www/html/app/Services/TelegramService.php:117 {▶} /var/www/html/app/Services/TelegramService.php:25 {▶} /var/www/html/app/Console/Commands/SaveTelegramPosts.php:23 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:36 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Util.php:41 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:93 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php:35 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php:662 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:213 {▶} /var/www/html/vendor/symfony/console/Command/Command.php:279 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Command.php:182 {▶} /var/www/html/vendor/symfony/console/Application.php:1047 {▶} /var/www/html/vendor/symfony/console/Application.php:316 {▶} /var/www/html/vendor/symfony/console/Application.php:167 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Console/Application.php:162 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php:423 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:357 {▶} /var/www/html/routes/web.php:15 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/CallableDispatcher.php:40 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php:238 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Route.php:209 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:806 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:144 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php:50 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php:88 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php:49 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:121 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php:64 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php:37 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php:75 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:805 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:784 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:748 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Routing/Router.php:737 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:200 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:144 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php:31 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php:21 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php:51 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/ValidatePostSize.php:27 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php:110 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/HandleCors.php:49 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php:57 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:183 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:119 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:175 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:144 {▶} /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:1176 {▶} /var/www/html/public/index.php:17 {▶} } }