From 96dea7553044afe58c4405d3215c2dbb2ddbfb40 Mon Sep 17 00:00:00 2001 From: Timofey <57951811+smotim@users.noreply.github.com> Date: Mon, 28 Sep 2026 00:19:42 +0500 Subject: [PATCH] Deprecate what the API no longer has Methods (per the API changelog and schema 0.0.33): - getChats(): GET /chats is not supported since June 2026 - getChatByLink(), deleteChat(): no longer documented, absent from the schema - addMembers(): POST /chats/{chatId}/members is limited since 9 September 2026 and removed on 30 September 2026 Models and enums absent from schema 0.0.33: the chat inline button, reply buttons and ReplyButtonType, Intent, MessageChatCreatedUpdate and its handlers, Chat::$chatMessageId. Only @deprecated tags and docs; nothing is removed, so existing code keeps working until a major release. README coverage map updated. --- README.md | 6 +++--- docs/README.md | 21 +++++++++++++------ src/Api.php | 10 +++++++++ src/Enums/InlineButtonType.php | 2 +- src/Enums/Intent.php | 3 +++ src/Enums/ReplyButtonType.php | 3 +++ src/Enums/UpdateType.php | 2 +- src/Laravel/MaxBotManager.php | 2 ++ .../Buttons/Inline/CallbackButton.php | 2 +- .../Attachments/Buttons/Inline/ChatButton.php | 2 ++ .../Buttons/Reply/AbstractReplyButton.php | 3 +++ .../Buttons/Reply/SendContactButton.php | 3 +++ .../Buttons/Reply/SendGeoLocationButton.php | 3 +++ .../Buttons/Reply/SendMessageButton.php | 3 +++ src/Models/Chat.php | 2 +- .../Updates/MessageChatCreatedUpdate.php | 2 ++ src/UpdateDispatcher.php | 2 ++ 17 files changed, 58 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 57efd11..582661b 100644 --- a/README.md +++ b/README.md @@ -187,10 +187,10 @@ $handler->handle(); #### Chats - [x] ~~`GET /chats` (`getChats`) - [*Получение списка всех чатов бота.*](./docs/README.md#Получение-списка-всех-чатов-бота-deprecated)~~ (deprecated) -- [x] `GET /chats/{chatLink}` (`getChatByLink`) - [*Получение информации о чате по ссылке.*](./docs/README.md#Получение-информации-о-чате-по-ссылке) +- [x] ~~`GET /chats/{chatLink}` (`getChatByLink`) - [*Получение информации о чате по ссылке.*](./docs/README.md#Получение-информации-о-чате-по-ссылке-deprecated)~~ (deprecated) - [x] `GET /chats/{chatId}` (`getChat`) - [*Получение информации о чате по ID.*](./docs/README.md#Получение-информации-о-чате-по-ID) - [x] `PATCH /chats/{chatId}` (`editChat`) - [*Редактирование информации о чате.*](./docs/README.md#Редактирование-информации-о-чате) -- [x] `DELETE /chats/{chatId}` (`deleteChat`) - [*Удаление чата.*](./docs/README.md#Удаление-чата) +- [x] ~~`DELETE /chats/{chatId}` (`deleteChat`) - [*Удаление чата.*](./docs/README.md#Удаление-чата-deprecated)~~ (deprecated) - [x] `POST /chats/{chatId}/actions` (`sendAction`) - [*Отправка действия в чат (например, "печатает...").*](./docs/README.md#Отправка-действия-в-чат) - [x] `GET /chats/{chatId}/pin` (`getPinnedMessage`) - [*Получение закрепленного сообщения.*](./docs/README.md#Получение-закрепленного-сообщения) - [x] `PUT /chats/{chatId}/pin` (`pinMessage`) - [*Закрепление сообщения.*](./docs/README.md#Закрепление-сообщения) @@ -201,7 +201,7 @@ $handler->handle(); - [x] `POST /chats/{chatId}/members/admins` (`addAdmins`) - [*Назначение администраторов чата.*](./docs/README.md#Назначение-администраторов-чата) - [x] `DELETE /chats/{chatId}/members/admins/{userId}` (`deleteAdmin`) - [*Снятие прав администратора.*](./docs/README.md#Снятие-прав-администратора) - [x] `GET /chats/{chatId}/members` (`getMembers`) - [*Получение участников чата.*](./docs/README.md#Получение-участников-чата) -- [x] `POST /chats/{chatId}/members` (`addMembers`) - [*Добавление участников в чат.*](./docs/README.md#Добавление-участников-в-чат) +- [x] ~~`POST /chats/{chatId}/members` (`addMembers`) - [*Добавление участников в чат.*](./docs/README.md#Добавление-участников-в-чат-deprecated)~~ (deprecated, удаляется 30.09.2026) - [x] `DELETE /chats/{chatId}/members` (`deleteMember`) - [*Удаление участника из чата.*](./docs/README.md#Удаление-участника-из-чата) #### Subscriptions diff --git a/docs/README.md b/docs/README.md index d0ceae9..892333f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -8,10 +8,10 @@ - ~~`PATCH /me` (`editBotInfo`)~~ - [*Редактирование информации о боте.*](#Редактирование-информации-о-боте-deprecated) (deprecated) - [Чаты](#Чаты) - ~~`GET /chats` (`getChats`)~~ - [*Получение списка всех чатов бота.*](#Получение-списка-всех-чатов-бота-deprecated) (deprecated) - - `GET /chats/{chatLink}` (`getChatByLink`) - [*Получение информации о чате по ссылке.*](#Получение-информации-о-чате-по-ссылке) + - ~~`GET /chats/{chatLink}` (`getChatByLink`)~~ - [*Получение информации о чате по ссылке.*](#Получение-информации-о-чате-по-ссылке-deprecated) (deprecated) - `GET /chats/{chatId}` (`getChat`) - [*Получение информации о чате по ID.*](#Получение-информации-о-чате-по-ID) - `PATCH /chats/{chatId}` (`editChat`) - [*Редактирование информации о чате.*](#Редактирование-информации-о-чате) - - `DELETE /chats/{chatId}` (`deleteChat`) - [*Удаление чата.*](#Удаление-чата) + - ~~`DELETE /chats/{chatId}` (`deleteChat`)~~ - [*Удаление чата.*](#Удаление-чата-deprecated) (deprecated) - `POST /chats/{chatId}/actions` (`sendAction`) - [*Отправка действия в чат (например, "печатает...").*](#Отправка-действия-в-чат) - `GET /chats/{chatId}/pin` (`getPinnedMessage`) - [*Получение закрепленного сообщения.*](#Получение-закрепленного-сообщения) - `PUT /chats/{chatId}/pin` (`pinMessage`) - [*Закрепление сообщения.*](#Закрепление-сообщения) @@ -22,7 +22,7 @@ - `POST /chats/{chatId}/members/admins` (`addAdmin`) - [*Назначение администраторов чата.*](#Назначение-администраторов-чата) - `DELETE /chats/{chatId}/members/admins/{userId}` (`deleteAdmins`) - [*Снятие прав администратора.*](#Снятие-прав-администратора) - `GET /chats/{chatId}/members` (`getMembers`) - [*Получение участников чата.*](#Получение-участников-чата) - - `POST /chats/{chatId}/members` (`addMembers`) - [*Добавление участников в чат.*](#Добавление-участников-в-чат) + - ~~`POST /chats/{chatId}/members` (`addMembers`)~~ - [*Добавление участников в чат.*](#Добавление-участников-в-чат-deprecated) (deprecated) - `DELETE /chats/{chatId}/members` (`deleteMember`) -[*Удаление участника из чата.*](#Удаление-участника-из-чата) - [Получение обновлений](#Получение-обновлений) - `GET /subscriptions` (`getSubscriptions`) - [*Получение списка Webhook-подписок.*](#Получение-списка-Webhook-подписок) @@ -160,6 +160,8 @@ $botInfo = $api->editBotInfo( ### Получение списка всех чатов бота (deprecated) +С июня 2026 API не поддерживает `GET /chats`. Идентификаторы чатов собирайте из событий `bot_added` и `bot_started`. + Возвращает информацию о чатах, в которых участвовал бот. Результат включает список чатов и маркер для перехода к следующей странице. @@ -170,7 +172,9 @@ $chats = $api->getChats( ); ``` -### Получение информации о чате по ссылке +### Получение информации о чате по ссылке (deprecated) + +Метода `GET /chats/{chatLink}` нет в документации и схеме Bot API с версии 0.0.33. Возвращает информацию о чате по его публичной ссылке, либо информацию о диалоге с пользователем по его username. @@ -197,7 +201,9 @@ $chat = $api->editChat( ); ``` -### Удаление чата +### Удаление чата (deprecated) + +Метода `DELETE /chats/{chatId}` нет в документации и схеме Bot API с версии 0.0.33. ```php $api->deleteChat(12345); @@ -283,7 +289,10 @@ $api->deleteAdmin( $chatMemberList = $api->getMembers(12345); ``` -### Добавление участников в чат +### Добавление участников в чат (deprecated) + +С 9 сентября 2026 метод `POST /chats/{chatId}/members` ограничен, 30 сентября 2026 его удаляют. Готовой замены в API +нет. ```php $api->addMembers( diff --git a/src/Api.php b/src/Api.php index 1577625..1c50515 100644 --- a/src/Api.php +++ b/src/Api.php @@ -605,6 +605,8 @@ class Api * * @param string $chatLink Public chat link (e.g., '@mychannel') or username (e.g., '@john_doe'). * + * @deprecated `GET /chats/{chatLink}` is not in the Bot API docs and schema since 0.0.33. + * * @return Chat * @throws ClientApiException * @throws NetworkException @@ -627,6 +629,9 @@ class Api * @param int|null $count Number of chats requested (1-100, default 50). * @param int|null $marker Points to the next data page. Use null for the first page. * + * @deprecated The API does not support `GET /chats` since June 2026. Collect chat ids + * from bot_added and bot_started updates instead. + * * @return ChatList * @throws ClientApiException * @throws NetworkException @@ -654,6 +659,8 @@ class Api * * @param int $chatId Chat identifier to delete. * + * @deprecated `DELETE /chats/{chatId}` is not in the Bot API docs and schema since 0.0.33. + * * @return Result * @throws ClientApiException * @throws NetworkException @@ -1176,6 +1183,9 @@ class Api * @param int $chatId The identifier of the chat. * @param int[] $userIds An array of user identifiers to add to the chat. * + * @deprecated `POST /chats/{chatId}/members` is limited since 9 September 2026 and removed + * on 30 September 2026; the API offers no replacement. + * * @return Result * @throws ClientApiException * @throws NetworkException diff --git a/src/Enums/InlineButtonType.php b/src/Enums/InlineButtonType.php index a20ef80..39fa520 100644 --- a/src/Enums/InlineButtonType.php +++ b/src/Enums/InlineButtonType.php @@ -12,6 +12,6 @@ enum InlineButtonType: string case RequestContact = 'request_contact'; case OpenApp = 'open_app'; case Message = 'message'; - case Chat = 'chat'; + case Chat = 'chat'; // @deprecated not in the schema since 0.0.33 case Clipboard = 'clipboard'; } diff --git a/src/Enums/Intent.php b/src/Enums/Intent.php index 3645ced..c4ba0e9 100644 --- a/src/Enums/Intent.php +++ b/src/Enums/Intent.php @@ -4,6 +4,9 @@ declare(strict_types=1); namespace BushlanovDev\MaxMessengerBot\Enums; +/** + * @deprecated Not part of the Bot API schema since 0.0.33. + */ enum Intent: string { case Positive = 'positive'; diff --git a/src/Enums/ReplyButtonType.php b/src/Enums/ReplyButtonType.php index 9c9bfc7..e808b7a 100644 --- a/src/Enums/ReplyButtonType.php +++ b/src/Enums/ReplyButtonType.php @@ -4,6 +4,9 @@ declare(strict_types=1); namespace BushlanovDev\MaxMessengerBot\Enums; +/** + * @deprecated Not part of the Bot API schema since 0.0.33. + */ enum ReplyButtonType: string { case Message = 'message'; diff --git a/src/Enums/UpdateType.php b/src/Enums/UpdateType.php index c0fa4c7..c766f45 100644 --- a/src/Enums/UpdateType.php +++ b/src/Enums/UpdateType.php @@ -24,7 +24,7 @@ enum UpdateType: string case BotStarted = 'bot_started'; case BotStopped = 'bot_stopped'; case ChatTitleChanged = 'chat_title_changed'; - case MessageChatCreated = 'message_chat_created'; + case MessageChatCreated = 'message_chat_created'; // @deprecated not in the schema since 0.0.33 case CommentCreated = 'comment_created'; case CommentEdited = 'comment_edited'; case CommentRemoved = 'comment_removed'; diff --git a/src/Laravel/MaxBotManager.php b/src/Laravel/MaxBotManager.php index 6464d98..a822327 100644 --- a/src/Laravel/MaxBotManager.php +++ b/src/Laravel/MaxBotManager.php @@ -349,6 +349,8 @@ readonly class MaxBotManager /** * Register a message chat created handler. * + * @deprecated message_chat_created is not in the Bot API schema since 0.0.33. + * * @param callable|string $handler Can be a closure, callable, or Laravel container binding. * * @throws BindingResolutionException diff --git a/src/Models/Attachments/Buttons/Inline/CallbackButton.php b/src/Models/Attachments/Buttons/Inline/CallbackButton.php index 96352e5..38fa75a 100644 --- a/src/Models/Attachments/Buttons/Inline/CallbackButton.php +++ b/src/Models/Attachments/Buttons/Inline/CallbackButton.php @@ -18,7 +18,7 @@ final readonly class CallbackButton extends AbstractInlineButton /** * @param string $text Visible button text (1 to 128 characters). * @param string $payload Button token (up to 1024 characters). - * @param Intent|null $intent The intent of the button. Affects how it is displayed by the client. + * @param Intent|null $intent The intent of the button. Affects how it is displayed by the client. Deprecated: not in the schema since 0.0.33. */ public function __construct(string $text, string $payload, ?Intent $intent = null) { diff --git a/src/Models/Attachments/Buttons/Inline/ChatButton.php b/src/Models/Attachments/Buttons/Inline/ChatButton.php index 201a3fd..3f73042 100644 --- a/src/Models/Attachments/Buttons/Inline/ChatButton.php +++ b/src/Models/Attachments/Buttons/Inline/ChatButton.php @@ -9,6 +9,8 @@ use BushlanovDev\MaxMessengerBot\Enums\InlineButtonType; /** * Button that creates a new chat associated with the message. * The bot will be added as an administrator by default. + * + * @deprecated Not part of the Bot API schema since 0.0.33. */ final readonly class ChatButton extends AbstractInlineButton { diff --git a/src/Models/Attachments/Buttons/Reply/AbstractReplyButton.php b/src/Models/Attachments/Buttons/Reply/AbstractReplyButton.php index 5d02042..ca8b4de 100644 --- a/src/Models/Attachments/Buttons/Reply/AbstractReplyButton.php +++ b/src/Models/Attachments/Buttons/Reply/AbstractReplyButton.php @@ -7,6 +7,9 @@ namespace BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Reply; use BushlanovDev\MaxMessengerBot\Enums\ReplyButtonType; use BushlanovDev\MaxMessengerBot\Models\AbstractModel; +/** + * @deprecated Not part of the Bot API schema since 0.0.33. + */ abstract readonly class AbstractReplyButton extends AbstractModel { /** diff --git a/src/Models/Attachments/Buttons/Reply/SendContactButton.php b/src/Models/Attachments/Buttons/Reply/SendContactButton.php index d6c29f4..f4dcc35 100644 --- a/src/Models/Attachments/Buttons/Reply/SendContactButton.php +++ b/src/Models/Attachments/Buttons/Reply/SendContactButton.php @@ -6,6 +6,9 @@ namespace BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Reply; use BushlanovDev\MaxMessengerBot\Enums\ReplyButtonType; +/** + * @deprecated Not part of the Bot API schema since 0.0.33. + */ final readonly class SendContactButton extends AbstractReplyButton { /** diff --git a/src/Models/Attachments/Buttons/Reply/SendGeoLocationButton.php b/src/Models/Attachments/Buttons/Reply/SendGeoLocationButton.php index f6a28bf..27085a9 100644 --- a/src/Models/Attachments/Buttons/Reply/SendGeoLocationButton.php +++ b/src/Models/Attachments/Buttons/Reply/SendGeoLocationButton.php @@ -6,6 +6,9 @@ namespace BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Reply; use BushlanovDev\MaxMessengerBot\Enums\ReplyButtonType; +/** + * @deprecated Not part of the Bot API schema since 0.0.33. + */ final readonly class SendGeoLocationButton extends AbstractReplyButton { /** diff --git a/src/Models/Attachments/Buttons/Reply/SendMessageButton.php b/src/Models/Attachments/Buttons/Reply/SendMessageButton.php index a9f4e4a..2033ef2 100644 --- a/src/Models/Attachments/Buttons/Reply/SendMessageButton.php +++ b/src/Models/Attachments/Buttons/Reply/SendMessageButton.php @@ -7,6 +7,9 @@ namespace BushlanovDev\MaxMessengerBot\Models\Attachments\Buttons\Reply; use BushlanovDev\MaxMessengerBot\Enums\Intent; use BushlanovDev\MaxMessengerBot\Enums\ReplyButtonType; +/** + * @deprecated Not part of the Bot API schema since 0.0.33. + */ final readonly class SendMessageButton extends AbstractReplyButton { /** diff --git a/src/Models/Chat.php b/src/Models/Chat.php index ee8110e..27c3fa7 100644 --- a/src/Models/Chat.php +++ b/src/Models/Chat.php @@ -26,7 +26,7 @@ final readonly class Chat extends AbstractModel * @param string|null $description Chat description. * @param UserWithPhoto|null $dialogWithUser Another user in conversation. For `dialog` type chats only. * @param int|null $messagesCount Messages count in chat. Only for group chats and channels. Not available for dialogs. - * @param string|null $chatMessageId Identifier of message that contains `chat` button initialized chat. + * @param string|null $chatMessageId Identifier of message that contains `chat` button initialized chat. Deprecated: not in the schema since 0.0.33. * @param Message|null $pinnedMessage Pinned message in chat or channel. Returned only when single chat is requested. * @param array|null $participants List of participants in chat. Returned only when single chat is requested. */ diff --git a/src/Models/Updates/MessageChatCreatedUpdate.php b/src/Models/Updates/MessageChatCreatedUpdate.php index edbbd7b..ceb5761 100644 --- a/src/Models/Updates/MessageChatCreatedUpdate.php +++ b/src/Models/Updates/MessageChatCreatedUpdate.php @@ -10,6 +10,8 @@ use BushlanovDev\MaxMessengerBot\Models\Chat; /** * Bot will get this update when a chat has been created as soon as * the first user clicked a `chat` button. + * + * @deprecated Not part of the Bot API schema since 0.0.33. */ final readonly class MessageChatCreatedUpdate extends AbstractUpdate { diff --git a/src/UpdateDispatcher.php b/src/UpdateDispatcher.php index d47f210..4d1de30 100644 --- a/src/UpdateDispatcher.php +++ b/src/UpdateDispatcher.php @@ -284,6 +284,8 @@ final class UpdateDispatcher /** * A convenient alias for addHandler(UpdateType::MessageChatCreated, $handler). * + * @deprecated message_chat_created is not in the Bot API schema since 0.0.33. + * * @param callable(Models\Updates\MessageChatCreatedUpdate, Api): void $handler * * @return $this