irazasyed / telegram-bot-sdk

πŸ€– Telegram Bot API PHP SDK. Lets you build Telegram Bots easily! Supports Laravel out of the box.

Home Page:https://telegram-bot-sdk.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

setChatPhoto always returns Bad Request: there is no photo in the request

bvicini opened this issue Β· comments

  • irazasyed/telegram-bot-sdk version: 3.9.#
  • PHP Version: 8.1.8
  • Laravel Version: 9.52.4 (optional)

Description:

setChatPhoto() always throws Bad Request: there is no photo in the request, even with the same (and working) InputFile used with sendPhoto()

Stacktrace:

~/.ignition.json.

[Bad Request: there is no photo in the request](http://localhost:8081/bupd#top)
Telegram
 \ 
Bot
 \ 
Exceptions
 \ 
TelegramResponseException
PHP 8.1.8
9.52.4
Bad Request: there is no photo in the request

Collapse vendor frames
Telegram
 \ 
Bot
 \ 
Exceptions
 \ 
TelegramResponseException
 
: 67
create
Telegram
 \ 
Bot
 \ 
TelegramResponse
 
: 101
makeException
Telegram
 \ 
Bot
 \ 
TelegramResponse
 
: 82
decodeBody
Telegram
 \ 
Bot
 \ 
TelegramResponse
 
: 52
__construct
Telegram
 \ 
Bot
 \ 
TelegramClient
 
: 130
getResponse
Telegram
 \ 
Bot
 \ 
TelegramClient
 
: 82
sendRequest
Telegram
 \ 
Bot
 \ 
Api
 
: 347
sendRequest
Telegram
 \ 
Bot
 \ 
Api
 
: 240
post
Telegram
 \ 
Bot
 \ 
Api
 
: 259
setChatPhoto
.unknown
0
call_user_func_array
Telegram
 \ 
Bot
 \ 
BotsManager
 
: 285
__call
Illuminate
 \ 
Support
 \ 
Facades
 \ 
Facade
 
: 338
__callStatic
Illuminate
 \ 
Routing
 \ 
RouteFileRegistrar
 
: 71
{closure}
Illuminate
 \ 
Routing
 \ 
CallableDispatcher
 
: 40
dispatch
Illuminate
 \ 
Routing
 \ 
Route
 
: 237
runCallable
Illuminate
 \ 
Routing
 \ 
Route
 
: 208
run

Steps To Reproduce:

Just a call to setChatPhoto(). Invoked in a closure in web route, with sendPhoto(), setChatTitle(), sendMessage(), getUpdates() all working.

Telegram::setChatPhoto( [
    'chat_id'   => '-xxxxxxxx',
    'photo'     => InputFile::create('assets/img/banchizator.jpg'),
]);