Auto open chatbot
# 🤝help
t
Is there a way to automatically get a chatbot to open on a webpage? without having to click anything?
d
I was wondering the same thing! It would be fantastic if this was a option
f
Hey there, You can add this to your JavaScript on your website
Copy code
javascript
      window.botpressWebChat.onEvent(
        function (event) {
          if (event.type === 'LIFECYCLE.LOADED') {
            window.botpressWebChat.sendEvent({ type: 'show' })
          }
        },
        ['LIFECYCLE.LOADED']
      )
t
window.botpressWebChat.onEvent( function (event) { if (event.type === 'LIFECYCLE.LOADED') { window.botpressWebChat.sendEvent({ type: 'show' }) } }, ['LIFECYCLE.LOADED'] )
this is my javascript code - the bot doesnt open automatically and im not sure what the probelm is (im very new to this)
f
It seems like it doesn't work for the V2 of the webchat 😦 Maybe @plain-lifeguard-16679 knows about this?
t
ive got it working on v0, thats more than fine for what i need
s
there is no other way to auto open it??
t
it can open automatically if you use webchat v0
i havent tried with v1
s
how can u use it?? cuz mine is 0.2.0
w
Is there a solution to auto open a V2 chatbot after e.g. 30 seconds?
176 Views