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() returns Bad Request: there is no photo in the request

bvicini opened this issue · comments

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

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.

Tested and working! Thank you!