setChatPhoto always returns Bad Request: there is no photo in the request
bvicini opened this issue Β· comments
bvicini commented
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'),
]);