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:

messageMapDetails of the message in the conversation (Attribute: text)
visitorMapDetails of the website visitor
operationStringDetails of the operations happen during the chat conversation (Attribute: chat, message)
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.

Sample Code:

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();
current_page_url = visitor.get("current_page_url");
	replies = {{"text":"You can recharge right here!"}};
	replies = {{"text":"You can recharge in the following 
return response;