Views: 1355 (Data available since 06.02.2017)
New Updates for Bitrix24 Bot Platform API.
The following fields:
EVENT_MESSAGE_DELETE were added to the methods imbot.register and imbot.update to enable subscription to events that update and delete messages.
New chatbot type with with advanced privileges (supervisor) was added. It is the chatbot that has access to all messages in chats, where it is a participant (to all chats, if it was invited with the access to history, and to new chats, if the access to history is not available to it).
To create a chatbot with advanced privileges, specify type
S in the
TYPE field in the imbot.register method.
Please be advised, if not required by the logic of your app, it is recommended for the chatbot to respond to the user messages only if this chatbot is mentioned. It can be checked via the
TO_USER_ID field, which will be passed into the event.
Another addition were the handlers that trace message edits and deletions (available for the chatbot of this type).
- The following new fields
ENTITY_ID were added to the method im.chat.add. These fields are used to perform quick search and identification of a chat in the following events: EVENT_MESSAGE_ADD, EVENT_MESSAGE_UPDATE, EVENT_MESSAGE_DELETE.
- Method imbot.update no longer supports updates of the
- New method is added: im.chat.get. It uses
ENTITY_ID to receive chat ID.
The following fields
CHAT_ENTITY_ID were added to these events: EVENT_MESSAGE_ADD, EVENT_MESSAGE_UPDATE, EVENT_MESSAGE_DELETE to identify a chat (you can specify these fields at the moment of creation).
- The field
TO_USER_ID is added to the following events: EVENT_MESSAGE_ADD, EVENT_MESSAGE_UPDATE. This field will contain the ID of the mentioned user. Thanks to this addition, in case of the 'S' type bot you will be able to understand, whether to respond or not to respond.
- Update for imbot.register and imbot.update: if all your event handlers will input the same address, instead of specifying
EVENT_BOT_DELETE - you can specify only
EVENT_HANDLER - its value will be automatically written into all the event handlers.
Method im.chat.add was supplemented by a new
OWNER_ID field, via which you can specify the chat owner.
The following methods were added to the Working with Chats (Bot API) section:
BOT_ID was added to all the Working with Chats (Bot API) methods.