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

setChatPhoto() returns Bad Request: there is no photo in the request #1045

Closed bvicini closed 1 year ago

bvicini commented 1 year ago

using laravel 10.2.0 | 9.25 PHP 8.2.4 telegram-bot-sdk version dev-develop I have a group where my bot is administrator when I register a new chat ID, I send a "setupGroup()" call where I try to set the chatPhoto of the group

this call always fails Telegram::setChatPhoto( [ 'chat_id' => $chatId, 'photo' => InputFile::create(public_path().'/telegram.png'), ]);

and gives this error image

while this one, in the same function, works Telegram::sendPhoto( [ 'chat_id' => $chatId, 'photo' => InputFile::create(public_path().'/telegram.png'), 'caption' => "Dummy message.", ]);

As additional Infos: setChatTitle, setChatDescription and deleteChatPhoto all work

The flag allMembersAreAdministrators is true (even if in the group there are members the aren't administrators)

Is there something that I'm doing wrong? Thank you in advance

irazasyed commented 1 year ago

This is fixed now. It was supposed to be posted as multipart but it wasn't. Please test now (use the develop branch to test). It'll be released in next version.

bvicini commented 1 year ago

Tested and working! Thank you!