Last Modified: 13.05.2022
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.like', Array(
'BOT_ID' => 39, // ID of chatbot that sends request. Is optional, there is only one chatbot
'MESSAGE_ID' => 1, // Message ID (any message, sent in personal dialogues or in group chats, where chatbot is located)
'ACTION' => 'auto' // Action, connected with method: plus – click «Like»; minus – «Like» is removed; auto – automatic calculation, tick should/shouldn't be specified. If not specified, it will work in auto mode
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 ID was not transmitted.
||After «Like» status call, it did not change.