This block sends a prepared message to the client if a key appears in the chat. The key is the word or phrase to which the bot should react.
You can choose whether the bot reacts to an incoming message from a client or an outgoing message from an operator. You can configure the bot to search for a key in both ways.
Reactions to the Phrase block can be used separately from the script: without connecting it to the main chain that begins with the start block. In this case, the reaction to the phrase happens at any point when the key appears.
Example. In the screenshot, you can see that the client can write "Promo code" and receive "SPRING2023" in response at any moment of the dialog.
Messages starting with "/" are called commands and the client does not see them.
1. Set "React to: Outgoing".
2. In the "Key" field, enter a command, for example /hello
3. In the message, enter the greeting text for clients.
The following screenshot shows a script in which the "Promo code" key won't be triggered until the client answers the question.
Several "Reactions to the Phrase" can follow any block. However, only one block can be output along with a “Reactions to the Phrase”. If you want the client to select one option, create multiple Reactions and one message block that will be triggered if no key is found. For example
In this example, there are two "Sending a message" blocks. Connect them in such a way that the first block is followed by the second block, and the second block is followed by the first block again. This way, sending the message "I don't understand you..." will bring the script back to the choices and allow the client to try again. Otherwise, the script will stop at the second block and the bot will stop responding to messages.
Watch our video tutorial about the “Reaction to the phrase” block or go on to the next block - “Closing the dialogue”.