# Struct event::MessageCreated

> `message.created`.

`zaun_community_protocol::event::MessageCreated` · Struct

```rust
pub struct MessageCreated { … }
```

`message.created`.

SPEC: the protocol says "message object", but the the protocol example body has only `message_id`,
`author_id`, `content`, `reply_to`, `mentions` and `attachments`; `channel_id`,
`sequence` and `created_at` are on the envelope, and a new message has no reactions. This
type follows the protocol; a host sending the full the protocol object still parses (extra fields are
ignored).

## Fields

### `message_id: MessageId`

Host-assigned id.

### `author_id: MemberId`

The author.

### `content: String`

≤ 4 000 scalars; empty only when the message has an attachment or an embed.

### `embeds: Vec<Embed>`

Rich embeds; absent when none.

### `components: Vec<Component>`

Components (bots only); absent when none.

### `flags: u32`

Message flags; absent when 0.

### `interaction_metadata: Option<Box<InteractionMetadata>>`

The interaction this message answers.

### `reply_to: Option<MessageId>`

The message replied to.

### `mentions: Mentions`

Who is mentioned (as honoured by the host).

### `attachments: Vec<Attachment>`

Attachments, in the order the author listed them.

## Trait implementations

`Clone`, `Debug`, `Deserialize<'de>`, `Eq`, `PartialEq`, `Serialize`, `StructuralPartialEq`

[Full rustdoc page](/docs/api/rust/zaun-community-protocol/zaun_community_protocol/event/body/message/struct.MessageCreated.html)
