https://discord.gg/botpress logo
Reset, Restart, or Create a new conversation
# 🤝help
l
Hi everyone, I need some help with my chatbot. My goal is to reset, restart, or create a new conversation based on a specific condition. Is this possible? Specifically, I want the chatbot to clear the conversation once the user logs out of the website, for data privacy purposes. This way, none of the previous messages will be visible to the next session. Thank you so much to anyone who can help or point me in the right direction!
e
Hello @little-magazine-52744, wsg? I’ve gone through what you want to get done and it’s possible by all ways so what are the result you will love to attain from this and are you ready to get started at the moment?
l
yes, i am now on my laptop, trying to do it what should I do, do you have any code there??
e
Awesome! What platform is your chatbot on, and how is the logout currently handled?
l
here is my code, i want to Reset, Restart, or Create a new conversation when the user logs out, for data privacy of conversation history of the user. We are using it on our wordpress website. Botpress Webchat Thanks a lot. https://cdn.discordapp.com/attachments/1388076918120910900/1388401192350122084/code.txt?ex=6860d8df&is=685f875f&hm=84f82d9ca2341f3a8047ec9907c59068e757ee7a0dd28fdfdc2683169bf69ab8&
e
Good, give me some time to go through what you sent
p
What is your workflow currently looking like? You might want to use the send custom event card and have a function in your code that does the restarting. Here's the docs' page about this: https://botpress.com/docs/webchat/interact/send-custom-events/from-webchat
l
Hi @prehistoric-airplane-85682 thank you for your response, I have already tried from what is on the documentation of the botpress, but it is not working on my end
hi @prehistoric-airplane-85682 i am now watching you right now
p
Can you still show your current workflow? Instead of using the send event card you can use the execute code card to send requests to an endpoint.
2 Views