Open different flows of the bot with custom button...
# 🤝help
hello everyone, I have a react app with a menu and I want each menu button to open the bot in a different conversation flow. it's possible?
@bright-magazine-792 correct me if i'm wrong, but I think this would be easier done using multiple bots atm.
Thanks for answer. Actually, I'm trying to do that, sending a custom event for each bot from my react menu and handling it in each bot's own before_incoming_middleware hook. but I get this message in the browser console every time I click the button: "Cannot send data until the webchat is ready botpress"
maybe I'm not sending the event correctly or setting the condition correctly in the hook, because at least it gives me the warning
This is the handler that I pass to my button of my menu:
Copy code
const handler = () => {
    // @ts-ignore
      type: 'custom-event',
      channel: 'web',
And this is my before_incoming_middleware hook:
Copy code
    if (event && event.type === 'custom-event') {
      botpressWebChat.webchatOpen ? 'hide' : 'show'
@acceptable-gold-88171 help please 😢
window.addEventListener("message", function(event) { if ( === "LIFECYCLE.LOADED") { // do what you want here } })
Try that
but I don't think we support custom-events right now