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:
Timofey
2026-09-28 00:08:35 +05:00
parent bf5219af7a
commit ca5ed4c100
9 changed files with 213 additions and 3 deletions
+14
View File
@@ -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.
*