I need the chatbot to start the conversation without the user sending the first message.
How can I configure my chatbot so that when the user opens it, the chatbot immediately welcomes them without the need for a first message from the user?
window.voiceflow.chat.open(). You also need to add a slight delay so it can render properly. window.voiceflow.chat.load() is used to load the chatbot, and window.voiceflow.chat.open() is used to open it. The setTimeout function is used to add a delay of 1000 milliseconds (or 1 second) to allow the chatbot to render properly before it opens.'xxxxxxxxxxxxxxxxxxxxx' with your project ID. You can find more information about other functions that the webchat can do here.
window.voiceflow.chat.open()window.voiceflow.chat.open()window.voiceflow.chat.load()setTimeout'xxxxxxxxxxxxxxxxxxxxx'(function(d, t) {
var v = d.createElement(t), s = d.getElementsByTagName(t)[0];
v.onload = function() {
window.voiceflow.chat.load({
verify: { projectID: 'xxxxxxxxxxxxxxxxxxxxx' },
url: 'https://general-runtime.voiceflow.com/',
versionID: 'production'
}).then(() => {
setTimeout(function() {
window.voiceflow.chat.open();
}, 1000);
});
}
v.src = "https://cdn.voiceflow.com/widget/bundle.mjs"; v.type = "text/javascript"; s.parentNode.insertBefore(v, s);
})(document, 'script');