# Struct Interaction

> Someone used one of this bot's commands, components or modals. Answer within 3 s (`respond`, or `Response::defer` first); follow-ups and edits work for 15 minutes.

`zaun_client::Interaction` · Struct

```rust
pub struct Interaction { … }
```

Someone used one of this bot's commands, components or modals. Answer within 3 s
(`respond`, or `Response::defer` first); follow-ups and edits work for
15 minutes.

## Methods

### `id`

```rust
pub fn id(&self) -> InteractionId
```

Its id.

### `kind`

```rust
pub fn kind(&self) -> InteractionType
```

Command, component, autocomplete or modal submit.

### `data`

```rust
pub fn data(&self) -> &Data
```

Everything the host sent.

### `channel`

```rust
pub fn channel(&self) -> Channel
```

The channel it happened in.

### `member`

```rust
pub fn member(&self) -> Member
```

Who used it.

### `command_name`

```rust
pub fn command_name(&self) -> Option<&str>
```

The command's name, for a command or autocomplete.

### `options`

```rust
pub fn options(&self) -> &[OptionValue]
```

The options given, for a command or autocomplete.

### `custom_id`

```rust
pub fn custom_id(&self) -> Option<&str>
```

The clicked component's or submitted modal's `custom_id`.

### `field`

```rust
pub fn field(&self, custom_id: &str) -> Option<&str>
```

A submitted modal input's text (`value`) by `custom_id`.

### `respond`

```rust
pub fn respond(&self, response: Response) -> Result<Replied>
```

Answers it (once, within 3 s).

# Errors
The host refused (too late, answered already, a body it does not accept).

### `reply`

```rust
pub fn reply<impl Into<String>>(&self, content: impl Into<String>) -> Result<Replied>
```

Answers with a text message in the channel.

# Errors
As `respond`.

### `reply_ephemeral`

```rust
pub fn reply_ephemeral<impl Into<String>>(&self, content: impl Into<String>) -> Result<Replied>
```

Answers with a message only the invoker sees.

# Errors
As `respond`.

### `followup`

```rust
pub fn followup(&self, body: MessageBody) -> Result<Replied>
```

Another message after the answer (up to 10, within 15 minutes).

# Errors
The host refused or did not answer.

### `edit_original`

```rust
pub fn edit_original(&self, body: MessageBody) -> Result<()>
```

Edits the answer (ends a deferred "thinking…"); absent fields stay.

# Errors
The host refused or did not answer.

### `delete_original`

```rust
pub fn delete_original(&self) -> Result<()>
```

Deletes the answer.

# Errors
The host refused or did not answer.

## Trait implementations

`Clone`, `Debug`

[Full rustdoc page](/docs/api/rust/zaun-client/zaun_client/bots/interaction/struct.Interaction.html)
