My customers are complaining that the chatbot is m...
# 🤝help
e
I don't know if it's because of the triggers code I added, if it's because of limitations on their server...What do you recommend?
m
@elegant-psychiatrist-26453 maybe try this? // Function to load the chatbot scripts function loadBotpressScripts() { // Load inject.js var injectScript = document.createElement('script'); injectScript.src = "https://cdn.botpress.cloud/webchat/v0/inject.js"; document.body.appendChild(injectScript); // Load config.js with defer var configScript = document.createElement('script'); configScript.src = "https://mediafiles.botpress.cloud/YOURBOTPRESSLINK"; configScript.defer = true; document.body.appendChild(configScript); } // Event listener to load the chatbot scripts after a delay (e.g., 5 seconds) setTimeout(loadBotpressScripts, 5000);
e
Thanks @User , today I am using this trigger code: window.botpressWebChat.onEvent( function (ev) { window.botpressWebChat.sendEvent({ type: "loadConversation", }); }, ["LIFECYCLE.LOADED"] ); window.addEventListener("message", function (event) { // console.log(event.data.type); if (event.data.type == "LIFECYCLE.READY") { window.botpressWebChat.sendEvent({ type: "trigger", channel: "web", payload: { text: "", }, }); } });
So I will try to use this one. But first, where can I find my botpress link to put here?
m
webchat intergration pre configured
its the same link i believe where yo can just share your chatbot
e
Ok!! I need to use this link even if my chatbot is a configurable one?
m
immm not sure
33 Views