# Struct Reply

> Builds a `MessageBody`. `Reply::from("text")` is the common case.

`zaun_bot::Reply` · Struct

```rust
pub struct Reply(…)
```

Builds a `MessageBody`. `Reply::from("text")` is the common case.

## Methods

### `new`

```rust
pub fn new() -> Self
```

An empty body.

### `content`

```rust
pub fn content<impl Into<String>>(self, text: impl Into<String>) -> Self
```

Sets the text (≤ 4 000 scalars).

### `embed`

```rust
pub fn embed<impl Into<Embed>>(self, embed: impl Into<Embed>) -> Self
```

Adds an embed (≤ 10).

### `row`

```rust
pub fn row(self, row: ActionRow) -> Self
```

Adds a row of buttons or one select.

### `component`

```rust
pub fn component(self, component: Component) -> Self
```

Adds any top-level component. Anything but an action row needs `v2`.

### `container`

```rust
pub fn container(self, container: Container) -> Self
```

Adds a Components V2 container and switches the message to V2 layout.

### `v2`

```rust
pub fn v2(self) -> Self
```

Uses Components V2 layout: no `content` or embeds, components carry everything.

### `ephemeral`

```rust
pub fn ephemeral(self) -> Self
```

Only the invoker sees it (interaction answers only).

### `silent`

```rust
pub fn silent(self) -> Self
```

Delivers without notifying anyone.

### `attachment`

```rust
pub fn attachment<impl Into<Id>>(self, id: impl Into<Id>) -> Self
```

Attaches a file uploaded with `crate::messages::upload`.

### `build`

```rust
pub fn build(self) -> MessageBody
```

The finished body.

### `mention_member`

```rust
pub fn mention_member<impl Into<Id>>(self, id: impl Into<Id>) -> Self
```

Notifies member `id` (write `mention::member` in the text to show where).

### `mention_members`

```rust
pub fn mention_members<impl IntoIterator<Item = Id>>(self, ids: impl IntoIterator<Item = Id>) -> Self
```

Notifies these members.

### `mention_role`

```rust
pub fn mention_role<impl Into<Id>>(self, id: impl Into<Id>) -> Self
```

Notifies the members with role `id` (write `mention::role` in the text).

### `mention_roles`

```rust
pub fn mention_roles<impl IntoIterator<Item = Id>>(self, ids: impl IntoIterator<Item = Id>) -> Self
```

Notifies the members with these roles.

### `mention_everyone`

```rust
pub fn mention_everyone(self) -> Self
```

Notifies everyone who can see the channel (needs `MENTION_EVERYONE`).

### `mentions`

```rust
pub fn mentions(self, mentions: Mentions) -> Self
```

Sets the mentions to exactly `mentions` (`mention::none()`: nobody; on an edit, clears
them).

### `mentions_from_content`

```rust
pub fn mentions_from_content(self) -> Self
```

Adds the mentions the content shows (`<@id>`, `<@&id>`, `@everyone`; see
`mention::parse`). Call it after `content`, and only for text the
bot wrote itself, never for text a member gave it.

## Trait implementations

`Clone`, `Debug`, `Default`, `From<&str>`, `From<EmbedBuilder>`, `From<String>`

[Full rustdoc page](/docs/api/rust/zaun-bot/zaun_bot/body/struct.Reply.html)
