Switch bots within the same chat window
# 🤝help
h
I'm trying to figure out how to switch the bot the user is on. For example, they are presented with a single choice option and if they choose option B, the bot switches to another chatbot. It doesn't seem this is a native feature but wondering if the pros know a workaround, can you edit the JS based on clicking a button in the chat?
f
Hey there, Have you though about just setting up different workflows for each bot?
h
Hey @fresh-fireman-491, I started doing that but here's the problem. I'm embedding that one bot into different pages, and I'm having issues when the user goes from one page to another, it reloads the old bot convo
f
Reloads as in keeps the old bot convo or makes a new?
h
keeps the old convo. on some of the flows, after a 5 second delay it will start the new flow. other's it will just continue the old flow on the new bot page
f
This code is used to clear the convo on reload. window.addEventListener('beforeunload', function() { sessionStorage.clear(); localStorage.clear(); }); You would add it to your JS file.
You can test it and let me know if it works. We can change it to work, if it doesn't, I would just need to know a bit more about when it should work
h
@fresh-fireman-491 this fixed it! you rock
f
That is amazing to hear and thank you!
c
You're right @helpful-electrician-82712 , he does rock!!
3 Views