...
Code Block |
---|
<html>
<head>
<title>Bot Plugin test</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css" integrity="sha512-1ycn6IcaQQ40/MKBW2W4Rhis/DbILU74C1vSrLJxCq57o941Ym01SwNsOMqvEBFlcgUa6xLiPY/NS5R+E6ztJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
</head>
<body>
<div id="orbitabot"
data-orbita-init='chatbot'
data-orbita-project-id='{{projectId}}'
data-orbita-server-url='{{req.headers.x-forwarded-proto}}://{{req.headers.host}}'
data-orbita-bot-container-id='chatWindow'
data-orbita-bot-content-id='messages'
data-orbita-bot-input-message-id = 'input'
data-orbita-bot-send-button-id = 'orbita-send-button'
data-orbita-bot-mic-id = 'chatMic'
data-orbita-bot-speaker-id = 'un-mute'
data-orbita-bot-menu-id = 'menu-icon'
data-orbita-bot-icon = 'chat-icon'
data-orbita-bot-close = 'menu'
data-orbita-custom-data = '{"chooseFlow": ""}'
data-orbita-bot-Settings='{"elementId": "orbitabot", "template": "default"}'></div>
<script src="/chatbot/v3/chat.js"></script>
</body>
</html> |
...
The hook function in Bot v3 allows us to publish messages to the chatbot dynamically from outside the Bot. The hook function's available keys are detailed below.
Key | Snippet Syntax | Description | Sample |
---|---|---|---|
|
| This is used to send information to the Bot. The value passed is treated as both the Sample: Passing user utterance to the Bot from the page in button click action/ page redirection. |
|
|
| This is used to send information to the Bot.
Sample: Passing a user friendly utterance to the Bot for display but also send complex data to the backend for business logic handling. |
|
|
| This re-establishes a socket connection. Send the |
|
|
| This allows to trigger an Event. The Event name is passed inside the |
|
|
| The socket connection will be disconnected. Send the |
|