Class WebChatbotListener
				
				
			
				
				
				
					
Defined in:  sdk.js.
				
			
| Constructor Attributes | Constructor Name and Description | 
|---|---|
| 
							
							 The WebChatbotListener provides an integration between a chat bot conversation through a SDKConnection and an HTML document. 
						 | 
					
| Field Attributes | Field Name and Description | 
|---|---|
| 
								
								 Disallow image/file upload menus and buttons. 
							 | 
						|
| 
								
								 Disallow speech. 
							 | 
						|
| 
								
								 Enable or disable avatar. 
							 | 
						|
| 
								
								 Set the avatar. 
							 | 
						|
| 
								
								 Allow the background color to be set. 
							 | 
						|
| 
								
								 Only apply the background color if not Chrome. 
							 | 
						|
| 
								
								 Set if the backlink should be displayed. 
							 | 
						|
| 
								
								 Allows the bot's thumbnail image to be set for chat log. 
							 | 
						|
| 
								
								 Set the location of the button and box, one of "bottom-right", "bottom-left", "top-right", "top-left". 
							 | 
						|
| 
								
								 Print response in chat bubble. 
							 | 
						|
| 
								
								 Set the caption for the button bar button. 
							 | 
						|
| 
								
								 Set if the box chat log should be shown. 
							 | 
						|
| 
								
								 Allow the button color to be set. 
							 | 
						|
| 
								
								 A SDK connection must be set, be sure to include your app id. 
							 | 
						|
| 
								
								 Support connections to external bots through their web API. 
							 | 
						|
| 
								
								 Configure if chat should be given focus after response. 
							 | 
						|
| 
								
								 Set styles explictly to avoid inheriting page styles. 
							 | 
						|
| 
								
								 Set if the avatar should request a specific video or image format. 
							 | 
						|
| 
								
								 Initial message to display from the bot. 
							 | 
						|
| 
								
								 Initial message to send to the bot. 
							 | 
						|
| 
								
								 Set if the avatar should request HD (high def) video/images. 
							 | 
						|
| 
								
								 Avatar image/video height. 
							 | 
						|
| 
								
								 Allow the hover button color to be set. 
							 | 
						|
| 
								
								 The id or name of the bot instance to connect to. 
							 | 
						|
| 
								
								 The name to display for the bot. 
							 | 
						|
| 
								
								 Set the language for the native voice. 
							 | 
						|
| 
								
								 This can be used to keep the bot's chat bar in synch with a livechat bar. 
							 | 
						|
| 
								
								 Loading message to display. 
							 | 
						|
| 
								
								 Configure if the browser's native voice TTS should be used. 
							 | 
						|
| 
								
								 Set the voice name for the native voice. 
							 | 
						|
| 
								
								 Chat bar offest from side. 
							 | 
						|
| 
								
								 onresponse event is raised after a response is received. 
							 | 
						|
| 
								
								 Override the URL used in the chat bot box popup. 
							 | 
						|
| 
								
								 Element id and class prefix. 
							 | 
						|
| 
								
								 Prompt for name/email before connecting. 
							 | 
						|
| 
								
								 Show Box Max 
							 | 
						|
| 
								
								 Remove language choice. 
							 | 
						|
| 
								
								 Add image/file upload buttons to toolbar. 
							 | 
						|
| 
								
								 Remove menubar. 
							 | 
						|
| 
								
								 Show Send Image 
							 | 
						|
| 
								
								 Enable or disable speech. 
							 | 
						|
| 
								
								 Add additional css style code. 
							 | 
						|
| 
								
								 Translate between the user's language, and the bot's language. 
							 | 
						|
| 
								
								 The name to display for the user. 
							 | 
						|
| 
								
								 Allows the user's thumbnail image to be set for chat log. 
							 | 
						|
| 
								
								 Allow the different style sheet options 
							 | 
						|
| 
								
								 Chat Button Vertial Offset 
							 | 
						|
| 
								
								 Avatar image/video width. 
							 | 
						
| Method Attributes | Method Name and Description | 
|---|---|
| 
								 clear()
								 
								Clear the chat console. 
							 | 
						|
| 
								 closeBox()
								 
								Close the embedding div in the current webpage. 
							 | 
						|
| 
								
								 Check contact info and connect. 
							 | 
						|
| 
								
								 Create an embedding bar and div in the current webpage. 
							 | 
						|
| 
								 createLiveChatBox(channel, label, position)
								 
								Create a live chat bar beside the bot bar. 
							 | 
						|
| 
								 exit()
								 
								Exit the conversation. 
							 | 
						|
| 
								 externalChat(chat)
								 
								Send an external API chat request. 
							 | 
						|
| 
								 greet()
								 
								Send the bot an empty message to let it greet the user. 
							 | 
						|
| 
								 initGame(game)
								 
								
							 | 
						|
| 
								 linkChatPostbacks(node)
								 
								Search for link using . 
							 | 
						|
| 
								
								 Maximize the embedding div in the current webpage. 
							 | 
						|
| 
								 message(user, message)
								 
								A chat message was received from the bot. 
							 | 
						|
| 
								
								 Minimize the embedding div in the current webpage. 
							 | 
						|
| 
								 popup()
								 
								Create a popup window chat session with the bot. 
							 | 
						|
| 
								 response(user, message)
								 
								A chat message was received from the bot. 
							 | 
						|
| 
								 sendCommand(json, processor)
								 
								Send the json command to the bot, and process the response. 
							 | 
						|
| 
								 sendFileAttachment(file, resize, form)
								 
								
							 | 
						|
| 
								 sendMessage(message)
								 
								Send the current text from the chat input as a message to the bot, and process the response. 
							 | 
						|
| 
								 start()
								 
								Initialize the bot listener. 
							 | 
						|
| 
								 updateAvatar(responseMessage)
								 
								Update the bot's avatar's image/video/audio from the chat response. 
							 | 
						
					Class Detail
				
				
				
						WebChatbotListener()
				
				
				
					The WebChatbotListener provides an integration between a chat bot conversation through a SDKConnection and an HTML document.
It updates the document to messages received from the connection, and sends messages from the document's form.
The HTML document requires the following elements:
				
				
				
				
					
					
					
					
					
					
					
			- chat - input (type='text') element for sending messages
 - send - input (type='submit') button for sending chat input
 - response - p element paragraph for last chat message
 - console - table element for chat log, and avatar
 - scroller - div element for chat log scroll pane
 - avatar - img element for the bot's avatar (optional)
 - avatar2 - img element hover img for the bot's avatar (optional)
 - avatar-image-div - div element for the bot's image (optional)
 - avatar-video - video element for the bot's video (optional)
 - avatar-video-div - div element for the bot's video (optional)
 - avatar-status - span element for the bot's current status (optional)
 
					Field Detail
				
				
					 
					
					
					
					allowFiles
					
					
					
						Disallow image/file upload menus and buttons.
						
						
					
					
					
						
						
						
						
					
					
					
					allowSpeech
					
					
					
						Disallow speech.
						
						
					
					
					
						
						
						
						
					
					
					
					avatar
					
					
					
						Enable or disable avatar.
						
						
					
					
					
						
						
						
						
					
					
					
					avatarId
					
					
					
						Set the avatar.
						
						
					
					
					
						
						
						
						
					
					
					
					background
					
					
					
						Allow the background color to be set.
						
						
					
					
					
						
						
						
						
					
					
					
					backgroundIfNotChrome
					
					
					
						Only apply the background color if not Chrome.
						
						
					
					
					
						
						
						
						
					
					
					
					backlink
					
					
					
						Set if the backlink should be displayed.
						
						
					
					
					
						
						
						
						
					
					
					
					botThumb
					
					
					
						Allows the bot's thumbnail image to be set for chat log.
						
						
					
					
					
						
						
						
						
					
					
					
					boxLocation
					
					
					
						Set the location of the button and box, one of "bottom-right", "bottom-left", "top-right", "top-left".
						
						
					
					
					
						
						
						
						
					
					
					
					bubble
					
					
					
						Print response in chat bubble.
						
						
					
					
					
						
						
						
						
					
					
					
					caption
					
					
					
						Set the caption for the button bar button.
						
						
					
					
					
						
						
						
						
					
					
					
					chatLog
					
					
					
						Set if the box chat log should be shown.
						
						
					
					
					
						
						
						
						
					
					
					
					color
					
					
					
						Allow the button color to be set.
						
						
					
					
					
						
						
						
						
					
					
					
					connection
					
					
					
						A SDK connection must be set, be sure to include your app id.
						
						
					
					
					
						
						
						
						
					
					
					
					external
					
					
					
						Support connections to external bots through their web API.
						
						
					
					
					
						
						
						
						
					
					
					
					focus
					
					
					
						Configure if chat should be given focus after response.
						
						
					
					
					
						
						
						
						
					
					
					
					forceStyles
					
					
					
						Set styles explictly to avoid inheriting page styles. Disable this to be able to override styles.
						
						
					
					
					
						
						
						
						
					
					
					
					format
					
					
					
						Set if the avatar should request a specific video or image format.
						
						
					
					
					
						
						
						
						
					
					
					
					greeting
					
					
					
						Initial message to display from the bot. (it is normally better to set a greeting in the bot instead).
						
						
					
					
					
						
						
						
						
					
					
					
					greetingMessage
					
					
					
						Initial message to send to the bot.
						
						
					
					
					
						
						
						
						
					
					
					
					hd
					
					
					
						Set if the avatar should request HD (high def) video/images.
						
						
					
					
					
						
						
						
						
					
					
					
					height
					
					
					
						Avatar image/video height.
						
						
					
					
					
						
						
						
						
					
					
					
					hoverColor
					
					
					
						Allow the hover button color to be set.
						
						
					
					
					
						
						
						
						
					
					
					
					instance
					
					
					
						The id or name of the bot instance to connect to.
						
						
					
					
					
						
						
						
						
					
					
					
					instanceName
					
					
					
						The name to display for the bot.
						
						
					
					
					
						
						
						
						
					
					
					
					lang
					
					
					
						Set the language for the native voice.
						
						
					
					
					
						
						
						
						
					
					
					
					livechatPrefix
					
					
					
						This can be used to keep the bot's chat bar in synch with a livechat bar.
						
						
					
					
					
						
						
						
						
					
					
					
					loading
					
					
					
						Loading message to display.
						
						
					
					
					
						
						
						
						
					
					
					
					nativeVoice
					
					
					
						Configure if the browser's native voice TTS should be used.
						
						
					
					
					
						
						
						
						
					
					
					
					nativeVoiceName
					
					
					
						Set the voice name for the native voice.
						
						
					
					
					
						
						
						
						
					
					
					
					offset
					
					
					
						Chat bar offest from side.
						
						
					
					
					
						
						
						
						
					
					
					
					onresponse
					
					
					
						onresponse event is raised after a response is received.
						
						
					
					
					
						
						
						
						
					
					
					
					popupURL
					
					
					
						Override the URL used in the chat bot box popup.
						
						
					
					
					
						
						
						
						
					
					
					
					prefix
					
					
					
						Element id and class prefix. This allows an id and class prefix to avoid name collisions on the element names for the chat, response, console, and avatar elements.
						
						
					
					
					
						
						
						
						
					
					
					
					promptContactInfo
					
					
					
						Prompt for name/email before connecting.
						
						
					
					
					
						
						
						
						
					
					
					
					showBoxmax
					
					
					
						Show Box Max
						
						
					
					
					
						
						
						
						
					
					
					
					showChooseLanguage
					
					
					
						Remove language choice.
						
						
					
					
					
						
						
						
						
					
					
					
					showFileButtons
					
					
					
						Add image/file upload buttons to toolbar.
						
						
					
					
					
						
						
						
						
					
					
					
					showMenubar
					
					
					
						Remove menubar.
						
						
					
					
					
						
						
						
						
					
					
					
					showSendImage
					
					
					
						Show Send Image
						
						
					
					
					
						
						
						
						
					
					
					
					speak
					
					
					
						Enable or disable speech.
						
						
					
					
					
						
						
						
						
					
					
					
					style
					
					
					
						Add additional css style code.
						
						
					
					
					
						
						
						
						
					
					
					
					translate
					
					
					
						Translate between the user's language, and the bot's language.
						
						
					
					
					
						
						
						
						
					
					
					
					userName
					
					
					
						The name to display for the user.
						
						
					
					
					
						
						
						
						
					
					
					
					userThumb
					
					
					
						Allows the user's thumbnail image to be set for chat log.
						
						
					
					
					
						
						
						
						
					
					
					
					version
					
					
					
						Allow the different style sheet options
						
						
					
					
					
						
						
						
						
					
					
					
					verticalOffset
					
					
					
						Chat Button Vertial Offset
						
						
					
					
					
						
						
						
						
					
					
					
					width
					
					
					
						Avatar image/video width.
						
						
					
					
					
						
						
						
						
					
				
			
		
			
				
					Method Detail
				
				
					 
					
					
					
					clear()
					
					
					
						Clear the chat console.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					closeBox()
					
					
					
						Close the embedding div in the current webpage.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					contactConnect()
					
					
					
						Check contact info and connect.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					createBox()
					
					
					
						Create an embedding bar and div in the current webpage.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					createLiveChatBox(channel, label, position)
					
					
					
						Create a live chat bar beside the bot bar.
						
						
					
					
					
					
						
							- Parameters:
 - channel
 - label
 - position
 
					
					
					exit()
					
					
					
						Exit the conversation.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					externalChat(chat)
					
					
					
						Send an external API chat request.
						
						
					
					
					
					
						
							- Parameters:
 - chat
 
					
					
					greet()
					
					
					
						Send the bot an empty message to let it greet the user.
This will have the bot respond with any defined greeting it has.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					initGame(game)
					
					
					- Parameters:
 - game
 
					
					
					linkChatPostbacks(node)
					
					
					
						Search for link using ...
Switch them to use an onclick to post the chat back to the bot.
						
						
					
					
					
					
						
							- Parameters:
 - node
 
					
					
					maximizeBox()
					
					
					
						Maximize the embedding div in the current webpage.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					message(user, message)
					
					
					
						A chat message was received from the bot.
						
						
					
					
					
					
						
							- Parameters:
 - user
 - message
 
					
					
					minimizeBox()
					
					
					
						Minimize the embedding div in the current webpage.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					popup()
					
					
					
						Create a popup window chat session with the bot.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					resizeAvatar()
					
					
					
					
					
					response(user, message)
					
					
					
						A chat message was received from the bot.
						
						
					
					
					
					
						
							- Parameters:
 - user
 - message
 
					
					
					sendAttachment()
					
					
					
					
					
					sendCommand(json, processor)
					
					
					
						Send the json command to the bot, and process the response.
						
						
					
					
					
					
						
							- Parameters:
 - json
 - processor
 
					
					
					sendFileAttachment(file, resize, form)
					
					
					- Parameters:
 - file
 - resize
 - form
 
					
					
					sendImage()
					
					
					
					
					
					sendMessage(message)
					
					
					
						Send the current text from the chat input as a message to the bot, and process the response.
						
						
					
					
					
					
						
							- Parameters:
 - message
 
					
					
					showAvatarBot()
					
					
					
					
					
					showChatLog()
					
					
					
					
					
					start()
					
					
					
						Initialize the bot listener.
						
						
					
					
					
					
						
						
						
						
						
						
						
					
					
					
					toggleSpeak()
					
					
					
					
					
					updateAvatar(responseMessage)
					
					
					
						Update the bot's avatar's image/video/audio from the chat response.
						
						
					
					
					
					
						
							- Parameters:
 - responseMessage