The below code needs to be implemented in the chatbot.js
file as shown below:
Ensure that no changes are done to the following js code:
function onLoginPageLoad(event) {
var source = event.getSource();
AdfCustomEvent.queue(source, "LoginChatbotEvent",
{
'someArg' : 'true'
},
true);
}
function onHomePageLoad(evt) {
var eventSource = evt.getSource();
AdfCustomEvent.queue(eventSource, "HomeChatbotEvent",
{
'someArg' : 'true'
},
true);
}
function initSdk(name, uri, channel) {
var chatWidgetSettings = {
initUserHiddenMessage : 'Hi', openChatOnLoad : false, URI : uri, channelId : channel,
font: '12px "Helvetica Neue", Helvetica, Arial, sans-serif',
locale: 'en-US',
enableClearMessage: true,
enableAutocomplete:false,
setSize:('400px' ,'786px'),
showConnectionStatus:true,
showTypingIndicator:true,
displayActionsAsPills:true,
enableSpeech:true,
enableAttachment:false,
enableBotAudioResponse: true,
skillVoices: [{
lang: 'en-US',
name: 'Samantha'
}, {
lang: 'en-US',
name: 'Alex'
}, {
lang: 'en-UK'
}]
};
if (!name) {
name = 'Bots';
}
setTimeout(function () {
const Bots = new WebSDK(chatWidgetSettings);// Initiate library with configuration
Bots.connect()// Connect to server
.then(function () {
})
window[name] = Bots;
});
}