Message Handler

Bot Message Handler

The Message Handler is invoked when the bot receives a message from the website visitor. The combination of messages we receive from the website visitor will be analysed and stored in the code(if the context handler is used) already, and the bot will respond to the visitors based on the question they receive from the available answers.

The attributes passed when a message handler is triggered are listed below:

InputsTypeDescription
messageMapDetails of the message in the conversation (Attribute: text)
visitorMapDetails of the website visitor
operationString

Details of the operations happen during the chat conversation (Attribute: chat, message)

chat: To handle replies for the first message from the visitor.

message: To handle replies for subsequent messages from the visitor.

requestMapDetails of the request

Message Handlers in Zoho SalesIQ - Bot

To embed the message handler script:

  • Navigate to Settings > Bots, click Add Bot.
  • Enter the name, description, choose website, departments and then select SalesIQ Script
  • Then, choose the Message Handler in the drop-down.
  • And then draft the script in the respective section, click Save and Publish.

Example of a Bot Message Handler

In this example, we have used a travel website called Zylker travels. And the bot acts as a travel assistant and guides the visitors visiting the website. Here, the Message handler will be invoked once the bot gets a reply from the visitor for the trigger initiated. So, the responses for the visitor message will be invoked.


response = Map();
response.put("action","reply");
current_page_url = visitor.get("current_page_url");
if(current_page_url.equals("recharge"))
{
	replies = {{"text":"You can recharge right here!"}};
	response.put("replies",replies);
}
else
{
	replies = {{"text":"You can recharge in the following 
                    [link](https://www.dth.com/recharge)"}};
	response.put("replies",replies);
}
return response;

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohosalesiq.com