How to use a message node to show an error to the end user

Hi there,
I wanted to display an error message(text with red colour) to the end-user in the bot flow. I can see these red coloured text bubbles in the bot when a bot error occurs. How can I emulate the same error message in the flow?

Thank you.

Hi Chandrahasan,
Please refer to the following code snippet for applying a color to the message presented to user:

var message={
   "type":"error",
   "payload":{
      "color":"#F35A00",
      "text":"sample for error template"
   }
}
print(JSON.stringify(message));

You could refer to the below link for more details on templates.
https://developer.kore.ai/docs/bots/sdks/message-templates/

Screenshots for the message presented in the color based on the color code configured at the message node.

image

image

image

1 Like

Thanks @Subrahmanyam . This is much helpful.

Please let me know if using/presenting a user error like this would affect the state of the bot, like does it assume that something wrong and restart the Intent?

No, it doesn’t. The template is just about applying a color to the message presented to user.

1 Like

Thank you. @Subrahmanyam