When your bot collected all leads and said the last word, you can end the chat using the close chat action.
The close chat action terminates ongoing chat session and prevents users from sending messages. The chat cannot be continued or modified. Instead, users can initiate a new chat with cleaned contexts and attributes by clicking Start the new chat button.
This action is designed for Chat Widget only. It means that if you use the story with other integrations, Close Chat will be ignored.
This action is designed for Chat Widget only. It means that if you use the story with other integrations, Close Chat will be ignored.
How to use the close chat action
Make sure that this is the right moment to close the chat. For example you can create a separate interaction named “End chat,” triggered by keywords such as “bye,” “thanks for your help” etc.
Go to the interaction that ends the chat. Click the Chat Widget icon to see available actions.
![Close Chat Widget](https://res.cloudinary.com/dn1j6dpd7/image/upload/v1638781463/cb-help/bot-responses/close-chat-widget/__bot-responses-close-chat-widget-1.png)2. **Add the Close Chat action** to your bot responses. ![Close Chat Widget](https://res.cloudinary.com/dn1j6dpd7/image/upload/v1638781463/cb-help/bot-responses/close-chat-widget/__bot-responses-close-chat-widget-2.png)3. Remember to place this action at the end of the responses. Actions and responses placed below Close Chat won't be triggered. ![Close Chat Widget](https://res.cloudinary.com/dn1j6dpd7/image/upload/v1638781463/cb-help/bot-responses/close-chat-widget/__bot-responses-close-chat-widget-3.png)
Start a free ChatBot trial and build your first chatbot today!