Users see multiple bot messages when only one is s...
# 🤝help
a
Hi, my nodes include only 3 messages but they often show up duplicated. Sometimes it's 2 times, sometimes it's 3. I experimented with the setup but always had the same outcome. How come? My bot pops up by itself through a code I added to my website. Attached below, maybe it somehow affects it? window.botpressWebChat.init({ 'composerPlaceholder': 'Chat with Patrick\'s GymBot', 'botConversationDescription': 'Patrick\'s Gym Virtual Assistant', 'botId': 'BOTID', 'hostUrl': 'https://cdn.botpress.cloud/webchat/v1', 'messagingUrl': 'https://messaging.botpress.cloud', 'clientId': 'CLIENT ID', 'webhookId': 'WEBHOOKID', 'lazySocket': true, 'themeName': 'prism', 'botName': 'Patrick\'s GymBot', 'stylesheet': 'https://webchat-styler-css.botpress.app/prod/code/185b80d2-4499-483b-b219-6350e82502c3/v5622/style.css', 'frontendVersion': 'v1', 'enableConversationDeletion': true, 'showPoweredBy': true, 'theme': 'prism', 'themeColor': '#2563eb' }); // executes when the page loads window.addEventListener('load', function() { // open the chatbot because the trigger doesn't work if the chatbot isn't open window.botpressWebChat.sendEvent({ type: 'show' }); // workaround using 'setTimeout' because the 'onEvent(function(), ["LIFECYCLE.LOADED"])' doesn't work, and we need to trigger this only after the chatbot is loaded setTimeout(function() { window.botpressWebChat.sendPayload({ type: 'trigger', payload: {} }); }, 5000); // 5 seconds, not too short to let it load, not too long to have a message too delayed });
Btw, this doesn't happen all the time. From what I'm seeing, it's around 30% of all interactions