Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 37 additions & 2 deletions docs/resources/message.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ An app will receive empty values in the `content`, `embeds`, `attachments`, and
| resolved? | [resolved](/docs/interactions/receiving-and-responding#interaction-object-resolved-data-structure) data | data for users, members, channels, and roles in the message's [auto-populated select menus](/docs/interactions/receiving-and-responding#interaction-response-object-modal) |
| poll? \[2\] | [poll](/docs/resources/poll#poll-object) object | A poll! |
| call? | [message call](/docs/resources/message#message-call-object) object | the call associated with the message |
| shared_client_theme? | [shared client theme](/docs/resources/message#shared-client-theme-object) object | the custom client-side theme shared via the message |

\[1\] The author object follows the structure of the user object, but is only a valid user in the case where the message is generated by a user or bot user. If the message is generated by a webhook, the author object corresponds to the webhook's id, username, and avatar. You can tell if a message is generated by a webhook by checking for the `webhook_id` on the message object.

Expand Down Expand Up @@ -766,6 +767,39 @@ Any entities whose id is included can be mentioned. Do note the API will silentl
| pinned_at | ISO8601 timestamp | the time the message was pinned |
| message | [message](/docs/resources/message#message-object) object | the pinned message |

### Shared Client Theme Object

###### Shared Client Theme Object Struture

| Field | Type | Description |
|----------------|---------------------------------------------------------|--------------------------------------------------------|
| colors | array of strings | the hexadecimal-encoded colors of the theme (max of 5) |
| gradient_angle | integer | the direction of the theme's colors (max of 360) |
| base_mix | integer | the intensity of the theme's colors (max of 100) |
| base_theme? | ?[base theme](/docs/resources/message#base-theme-types) | the mode of the theme |

###### Base Theme Types

| Type | Value |
|----------|-------|
| DARK | 1 |
| LIGHT | 2 |
| DARKER | 3 |
| MIDNIGHT | 4 |

###### Example Shared Client Theme

```json
{
"shared_client_theme": {
"colors": ["5865F2", "7258F2", "9858F2", "BE58F2", "E558F2"],
"gradient_angle": 0,
"base_mix": 58,
"base_theme": 1
}
}
```

## Get Channel Messages
<Route method="GET">/channels/[\{channel.id\}](/docs/resources/channel#channel-object)/messages</Route>

Expand Down Expand Up @@ -836,10 +870,11 @@ Files must be attached using a `multipart/form-data` body as described in [Uploa
| flags?\*\* | integer | [Message flags](/docs/resources/message#message-object-message-flags) combined as a [bitfield](https://en.wikipedia.org/wiki/Bit_field) (only `SUPPRESS_EMBEDS`, `SUPPRESS_NOTIFICATIONS`, `IS_VOICE_MESSAGE`, and `IS_COMPONENTS_V2` can be set) |
| enforce_nonce? | boolean | If true and nonce is present, it will be checked for uniqueness in the past few minutes. If another message was created by the same author with the same nonce, that message will be returned and no new message will be created. |
| poll? | [poll](/docs/resources/poll#poll-create-request-object) request object | A poll! |
| shared_client_theme? | [shared client theme object](/docs/resources/message#shared-client-theme-object) | The custom client-side theme to share via the message |

\* At least one of `content`, `embeds`, `sticker_ids`, `components`, `files[n]`, or `poll` is required. When forwarding a message, only `message_reference` is required.
\* At least one of `content`, `embeds`, `sticker_ids`, `components`, `files[n]`, `poll` or `shared_client_theme` is required. When forwarding a message, only `message_reference` is required.

\*\* When the flag `IS_COMPONENTS_V2` is set, the message can only contain `components`. Providing `content`, `embeds`, `sticker_ids`, `files[n]`, or `poll` will fail with a 400 BAD REQUEST response.
\*\* When the flag `IS_COMPONENTS_V2` is set, the message can only contain `components`. Providing `content`, `embeds`, `sticker_ids`, `files[n]`, `poll` or `shared_client_theme` will fail with a 400 BAD REQUEST response.

###### Example Request Body (application/json)

Expand Down