# script_dialog

Fires when the bot receives a scripted dialog with menu buttons.

```javascript
Bot.on("script_dialog", function(event) { ... });
```

Use [replyDialog](/doc/4bf52c72-e8d6-4c7a-981e-bebd6b545e14) to “click” a required menu button.

```snippet playground-event-reference-g2mvxMrKkd
name        | The name of the event — in this case `script_dialog`
buttons     | The selection options (buttons) as an array
channel     | The channel on which the dialog listens
owner_name  | The name of the owner of the object that sent the dialog
text        | The text displayed in the dialog window
object_uuid | The UUID of the object that sent the dialog
object_name | The name of the object that sent the dialog
```

## Example

```javascript
Bot.on("script_dialog", function(event) {
  console.log(
    "Got a dialog:\n" +
    event.text + "\n\n" +
    "channel: " + event.channel + "\n" +
    "buttons:\n" + event.buttons.join("\n")
  );
});
```