Messages
The message object
| Field | Type | Notes |
|---|---|---|
id | string | |
channel_id | string | |
author | User | |
content | string | Empty if the message only has files or cards |
created_at | number | |
edited_at | number or null | |
reply_to | object or null | The message this one replies to |
pinned_at | number or null | |
attachments | array | Files. Bots can see them but can't download or upload files yet. |
reactions | array | Each has emoji, count, and me (true if your bot reacted) |
kind | string | default, or join for the line that welcomes a new member |
embeds | array | Cards |
interaction | object or null | The command this message answers: its id, command and user |
reply_to has the original message's id, its author (null if it was deleted), the first 120 characters of its content, and how many attachments it has.
Get messages
GET/channels/{channel_id}/messages
Optional: limit (1–100, default 50), and before or after with a message ID. Oldest first.
GET/channels/{channel_id}/messages/{message_id}
One message.
Send a message
POST/channels/{channel_id}/messages
{ "content": "pong", "reply_to": "1234567890123456790" }content is up to 2000 characters. It can be empty when you send embeds. reply_to is optional and has to be a message in the same channel. Needs SEND_MESSAGES. Returns 201 with the new message.
Edit a message
PATCH/channels/{channel_id}/messages/{message_id}
Send content, embeds or both. Whatever you leave out stays the same, and "embeds": [] removes the cards. Bots can only edit their own messages. Returns the updated message.
Delete a message
DELETE/channels/{channel_id}/messages/{message_id}
Your bot's own messages, or anyone's with MANAGE_MESSAGES. Returns 204.
Reactions
PUT/channels/{channel_id}/messages/{message_id}/reactions/{emoji}
DELETE/channels/{channel_id}/messages/{message_id}/reactions/{emoji}
Adds or removes your bot's reaction. URL-encode the emoji (👍 becomes %F0%9F%91%8D). Needs SEND_MESSAGES. Returns 204.
Pins
GET/channels/{channel_id}/pins
PUT/channels/{channel_id}/pins/{message_id}
DELETE/channels/{channel_id}/pins/{message_id}
Lists the pinned messages, or pins and unpins one. Pinning needs MANAGE_MESSAGES, and a channel holds up to 50 pins. Pin and unpin return 204.
Cards
A message can carry up to 4 cards:
{
"content": "",
"embeds": [
{
"title": "Weather in Tehran",
"url": "https://example.com/tehran",
"description": "Sunny all day",
"color": 5995503,
"fields": [
{ "name": "High", "value": "31°", "inline": true },
{ "name": "Low", "value": "18°", "inline": true }
],
"footer": "Updated at noon"
}
]
}| Field | Limit | Notes |
|---|---|---|
title | 256 characters | |
url | 500 characters | http or https. Makes the title a link. |
description | 2000 characters | Formatting and links work, like in messages |
color | 0 to 0xFFFFFF | The stripe on the side, as a number |
fields | 10 | Each has a name (256), a value (1024) and inline. Inline fields sit side by side. |
footer | 256 characters |
Every card needs a title, a description or fields, and all the text in a message's cards adds up to 6000 characters at most. Only bots send cards, and AutoMod checks their text and links like any other message.