mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-10-09 05:17:31 +00:00
Add editBotCommands for PATCH /me/commands, deprecate editBotInfo
The API no longer accepts PATCH /me: it answers "Path /me is not recognized", so editBotInfo() fails, including for commands. Commands now have their own endpoint, PATCH /me/commands (editMyCommands in the official schema); bot name, description and photo are edited on the MAX partner platform. - Api::editBotCommands(BotCommand[]): BotCommandsInfo - BotCommandsInfo model and ModelFactory::createBotCommandsInfo() - editBotInfo() and BotPatch marked @deprecated - README coverage map and docs updated
This commit is contained in:
@@ -32,6 +32,7 @@ use BushlanovDev\MaxMessengerBot\Models\Attachments\PhotoAttachment;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\ShareAttachment;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\StickerAttachment;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Attachments\VideoAttachment;
|
||||
use BushlanovDev\MaxMessengerBot\Models\BotCommandsInfo;
|
||||
use BushlanovDev\MaxMessengerBot\Models\BotInfo;
|
||||
use BushlanovDev\MaxMessengerBot\Models\Chat;
|
||||
use BushlanovDev\MaxMessengerBot\Models\ChatList;
|
||||
@@ -106,6 +107,19 @@ readonly class ModelFactory
|
||||
return Result::fromArray($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Commands of the current bot.
|
||||
*
|
||||
* @param array<string, mixed> $data
|
||||
*
|
||||
* @return BotCommandsInfo
|
||||
* @throws ReflectionException
|
||||
*/
|
||||
public function createBotCommandsInfo(array $data): BotCommandsInfo
|
||||
{
|
||||
return BotCommandsInfo::fromArray($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Information about the current bot.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user