Trigger to start when user types a certain keyword
# 🤝help
c
I would like for the Bot to only start when a specific keyword like 'swim' is being said. Other than that, the bot does not start. Does anyone know how to do that?
e
Hey @careful-keyboard-68830, you mean start with a message right?
There are two ways to do that: 1. Add an intent to the first node with training phrases that include the desired keywork, this intent then transitions to another node where you properly start the conversation. If the first user message doesn't match the intent, the conversation will end with no message from the bot (which is bad in my opinion - you should add an "always" transition that goes to another node where the bot says it can't help them with that
2. Add an AI task with instructions like: "Check what the user has said and if includes the "swim" keyword or similar, set the isInScope variable to true, otherwise, set it to false" The input should be: User input: {{event.preview}} And the result should be stored in a boolean variable called isInScope. Now after the AI task you will add one expression that check if isInScope is true, and if so, proceeds with the conversation. Now add another expression that checks if isInScope is false (it could also be "always", since it will always be false in this case), and that expression leads to the End node
Let me know if that helps!
c
The first one seems like a simple enough solution! I have also found expression to work. Just match event.preview with the keyword. Thanks for your help! 🙂
e
Happy to know it worked! But just a tip - it's better using intents because the user might say some similar word and it should match too!
c
Thanks for the tip!
e
Anytime!
2 Views