Discord · Schema
Discord Message
A message sent in a channel within Discord, containing content, embeds, attachments, reactions, and other rich features.
ChatCommunicationGamingMessagingSocialVideoVoice
Properties
| Name | Type | Description |
|---|---|---|
| id | string | Message ID (Snowflake) |
| channel_id | string | ID of the channel the message was sent in |
| author | object | |
| content | string | Contents of the message |
| timestamp | string | When this message was sent |
| edited_timestamp | stringnull | When this message was edited (null if never) |
| tts | boolean | Whether this was a text-to-speech message |
| mention_everyone | boolean | Whether this message mentions everyone |
| mentions | array | Users specifically mentioned in the message |
| mention_roles | array | Roles specifically mentioned in this message |
| mention_channels | array | Channels mentioned in this message (crosspost only) |
| attachments | array | Attached files |
| embeds | array | Embedded content |
| reactions | array | Reactions to the message |
| nonce | object | Used for validating a message was sent |
| pinned | boolean | Whether this message is pinned |
| webhook_id | string | If generated by a webhook, this is the webhook's ID |
| type | integer | Type of message |
| flags | integer | Message flags combined as a bitfield |
| referenced_message | object | The message associated with the message_reference |
| thread | object | Thread started from this message |
| components | array | Message components (buttons, selects, etc.) |
| sticker_items | array | Stickers sent with the message |
| position | integer | Approximate position of the message in a thread |
JSON Schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://discord.com/developers/schemas/discord/message.json",
"title": "Discord Message",
"description": "A message sent in a channel within Discord, containing content, embeds, attachments, reactions, and other rich features.",
"type": "object",
"required": ["id", "channel_id", "author", "content", "timestamp", "tts", "mention_everyone", "mentions", "mention_roles", "attachments", "embeds", "pinned", "type"],
"properties": {
"id": {
"type": "string",
"description": "Message ID (Snowflake)",
"pattern": "^[0-9]+$"
},
"channel_id": {
"type": "string",
"description": "ID of the channel the message was sent in"
},
"author": {
"$ref": "discord-user-schema.json"
},
"content": {
"type": "string",
"description": "Contents of the message",
"maxLength": 2000
},
"timestamp": {
"type": "string",
"format": "date-time",
"description": "When this message was sent"
},
"edited_timestamp": {
"type": ["string", "null"],
"format": "date-time",
"description": "When this message was edited (null if never)"
},
"tts": {
"type": "boolean",
"description": "Whether this was a text-to-speech message"
},
"mention_everyone": {
"type": "boolean",
"description": "Whether this message mentions everyone"
},
"mentions": {
"type": "array",
"description": "Users specifically mentioned in the message",
"items": {
"$ref": "discord-user-schema.json"
}
},
"mention_roles": {
"type": "array",
"description": "Roles specifically mentioned in this message",
"items": {
"type": "string"
}
},
"mention_channels": {
"type": "array",
"description": "Channels mentioned in this message (crosspost only)",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"guild_id": { "type": "string" },
"type": { "type": "integer" },
"name": { "type": "string" }
}
}
},
"attachments": {
"type": "array",
"description": "Attached files",
"items": {
"$ref": "#/$defs/Attachment"
}
},
"embeds": {
"type": "array",
"description": "Embedded content",
"items": {
"$ref": "#/$defs/Embed"
},
"maxItems": 10
},
"reactions": {
"type": "array",
"description": "Reactions to the message",
"items": {
"$ref": "#/$defs/Reaction"
}
},
"nonce": {
"description": "Used for validating a message was sent",
"oneOf": [
{ "type": "string" },
{ "type": "integer" }
]
},
"pinned": {
"type": "boolean",
"description": "Whether this message is pinned"
},
"webhook_id": {
"type": "string",
"description": "If generated by a webhook, this is the webhook's ID"
},
"type": {
"type": "integer",
"description": "Type of message"
},
"flags": {
"type": "integer",
"description": "Message flags combined as a bitfield"
},
"referenced_message": {
"description": "The message associated with the message_reference",
"oneOf": [
{ "$ref": "#" },
{ "type": "null" }
]
},
"thread": {
"$ref": "discord-channel-schema.json",
"description": "Thread started from this message"
},
"components": {
"type": "array",
"description": "Message components (buttons, selects, etc.)",
"items": {
"type": "object"
}
},
"sticker_items": {
"type": "array",
"description": "Stickers sent with the message",
"items": {
"type": "object",
"properties": {
"id": { "type": "string" },
"name": { "type": "string" },
"format_type": { "type": "integer" }
}
}
},
"position": {
"type": "integer",
"description": "Approximate position of the message in a thread"
}
},
"$defs": {
"Attachment": {
"type": "object",
"description": "A file attached to a message",
"required": ["id", "filename", "size", "url", "proxy_url"],
"properties": {
"id": {
"type": "string",
"description": "Attachment ID"
},
"filename": {
"type": "string",
"description": "Name of the file"
},
"description": {
"type": "string",
"description": "Description for the file (alt text)"
},
"content_type": {
"type": "string",
"description": "Media type of the file"
},
"size": {
"type": "integer",
"description": "Size of the file in bytes"
},
"url": {
"type": "string",
"format": "uri",
"description": "Source URL of the file"
},
"proxy_url": {
"type": "string",
"format": "uri",
"description": "Proxied URL of the file"
},
"height": {
"type": ["integer", "null"],
"description": "Height of image"
},
"width": {
"type": ["integer", "null"],
"description": "Width of image"
},
"ephemeral": {
"type": "boolean",
"description": "Whether this attachment is ephemeral"
},
"duration_secs": {
"type": "number",
"description": "Duration of audio file in seconds"
},
"waveform": {
"type": "string",
"description": "Base64-encoded waveform data for voice messages"
},
"flags": {
"type": "integer",
"description": "Attachment flags"
}
}
},
"Embed": {
"type": "object",
"description": "Embedded rich content in a message",
"properties": {
"title": {
"type": "string",
"maxLength": 256
},
"type": {
"type": "string",
"description": "Type of embed"
},
"description": {
"type": "string",
"maxLength": 4096
},
"url": {
"type": "string",
"format": "uri"
},
"timestamp": {
"type": "string",
"format": "date-time"
},
"color": {
"type": "integer"
},
"footer": {
"type": "object",
"properties": {
"text": { "type": "string", "maxLength": 2048 },
"icon_url": { "type": "string", "format": "uri" },
"proxy_icon_url": { "type": "string", "format": "uri" }
},
"required": ["text"]
},
"image": {
"type": "object",
"properties": {
"url": { "type": "string", "format": "uri" },
"proxy_url": { "type": "string", "format": "uri" },
"height": { "type": "integer" },
"width": { "type": "integer" }
}
},
"thumbnail": {
"type": "object",
"properties": {
"url": { "type": "string", "format": "uri" },
"proxy_url": { "type": "string", "format": "uri" },
"height": { "type": "integer" },
"width": { "type": "integer" }
}
},
"video": {
"type": "object",
"properties": {
"url": { "type": "string", "format": "uri" },
"height": { "type": "integer" },
"width": { "type": "integer" }
}
},
"provider": {
"type": "object",
"properties": {
"name": { "type": "string" },
"url": { "type": "string", "format": "uri" }
}
},
"author": {
"type": "object",
"properties": {
"name": { "type": "string", "maxLength": 256 },
"url": { "type": "string", "format": "uri" },
"icon_url": { "type": "string", "format": "uri" },
"proxy_icon_url": { "type": "string", "format": "uri" }
}
},
"fields": {
"type": "array",
"items": {
"type": "object",
"required": ["name", "value"],
"properties": {
"name": { "type": "string", "maxLength": 256 },
"value": { "type": "string", "maxLength": 1024 },
"inline": { "type": "boolean" }
}
},
"maxItems": 25
}
}
},
"Reaction": {
"type": "object",
"description": "A reaction to a message",
"properties": {
"count": {
"type": "integer",
"description": "Total number of times this emoji has been used"
},
"count_details": {
"type": "object",
"properties": {
"burst": { "type": "integer" },
"normal": { "type": "integer" }
}
},
"me": {
"type": "boolean",
"description": "Whether the current user reacted"
},
"me_burst": {
"type": "boolean",
"description": "Whether the current user super-reacted"
},
"emoji": {
"$ref": "discord-emoji-schema.json"
},
"burst_colors": {
"type": "array",
"items": { "type": "string" }
}
}
}
}
}