# How to close empty requests from the chat widget?
## Symptoms

Empty chat requests are being created.

## Solution

1. Create a new event action with the type **Script** in **Settings - Event Actions**.
2. Disable the option **Ignore past events**.
3. Specify the following conditions:
    * Event type: Request created
    * Request: Status = New
    * Number of responses = 0
    * Source channel: Channel type = Widget
    * Request: Created: specify the time after which the request will be closed if the client does not write anything
4. Add the `comment_body` variable to the additional context with the text of the response message:
    ```
    {
      "comment_body": "Hello! <br/>You did not write a message, so the request will be closed."
    }
    ```
    :::tip
    If you do not add the variable, the standard text from the code will be used. If you want to send a different response, replace the text with the desired one.
    :::
5. Attach the script from the attachment as an action: [close_empty_chat.py](https://support.swarmica.com/attachments/K/c/Kc2Xujlu7O7Eaih9_a/close_empty_chat.py)
6. Enable the trigger.

![](https://support.swarmica.com/attachments/7/i/7ixhYRaGTPbQi6nO_a/Screenshot_2026-08-31_at_15.14.35.png)

## Cause

The ticket is created by clicking **Start chat**, even if the client does not write anything.