Bot Status Change Handler

The status change handler is triggered when the user changes his custom status. The attributes passed when a status change handler is executed are:

Attribute NameDescription

existing_status

Argument with the existing status : "text" and "state"

text : The existing status set by the user.

state : State represents the status code of the user. It can be either Available | Busy 

current_status

Argument with the new status :"text" and "state"

text : The new status set by the user.

state : State represents the status code of the user. It can be either Available | Busy

user

Details of the user  who changed their status.

Note: The Status Handler is triggered ONLY when a custom status is updated.

Example:

Configure your bot's status handler to automatically update your colleagues when you update your custom status in Cliq. Here the broadcast = true param, will post a message to all your bot subscribers and the  current_status.get("text") function gets the updated status.

To get the state of the new status, use the current_status.get("state") function. Take a look at the sample syntax to notify your bot subscribers when you change your custom status. 

//Sample Syntax for Bot Status Handler

response = Map();
response.put("text","Guys! " + user.get("first_name") + " has updated the status to *" + current_status.get("text") + "* ");
response.put("broadcast","true");
zoho.cliq.postToBot("<your_bot_name>",response);
return response;

Bot status handler triggered on changing the custom status