Last Modified: 13.05.2022
Updates (changes) the chatbot message
function is used here for illustration purposes only. It is taken from the EchoBot
example. You can send a REST command with your own function, or use the BX24.callMethod
These methods of message processing are usually employed when the user is typing something, that is why the ONIMBOTMESSAGEADD
event must be processed.
$result = restCommand('imbot.message.update', Array(
'BOT_ID' => 39, // ID of chatbot that sends request. Is optional, there is only one chatbot
'MESSAGE_ID' => 1, // Message ID
'MESSAGE' => 'answer text' // Message text, optional field, if null value is specified – message will be deleted
'ATTACH' => '' // Attachment, optional field
'KEYBOARD' => '' // Keyboard, optional field
'MENU' => '' // Context menu, optional field
'URL_PREVIEW' => 'Y' // Convert links to rich-links, optional field, by default 'Y'
true or error.
Possible error codes
||Chatbot not found.
||Chatbot is not part of this application: you can only work with chatbots, installed within application framework.
||Message text is not transmitted.
||You do not have access to this message or time to modify it has expired (more than 3 days passed since publishing).
||Complete transmitted attachment was not validated.
||Maximum permissible attachment size was exceeded (30 Kb).
||Complete transmitted keyboard object was not validated.
||Maximum permissible keyboard size was exceeded (30 Kb).
||Complete transmitted menu object was not validated.
||Maximum permissible menu size was exceeded (30 Kb).