mirror of
https://github.com/BushlanovDev/max-bot-api-client-php.git
synced 2026-10-06 20:10:31 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
+15
-6
@@ -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(
|
||||
|
||||
+10
@@ -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
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/**
|
||||
|
||||
@@ -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
|
||||
{
|
||||
/**
|
||||
|
||||
+1
-1
@@ -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<string, int>|null $participants List of participants in chat. Returned only when single chat is requested.
|
||||
*/
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user