Passa al contenuto principale

V3 Message Schema Reference

This document describes the JSON data format used by the SCNX Message Editor V3. This is the primary message format used across SCNX for bot messages, shared content, and configuration templates.


Schema Detection

V3 messages are identified by the _schema field:

{ "_schema": "v3", "content": "Hello!", "embeds": [...] }

If _schema is missing or set to "v2", the message uses a legacy format that is auto-converted to V3 on edit.


Top-Level Fields

FieldTypeRequiredDescription
_schemastringYesAlways "v3"
contentstringConditionalMain message text. Max 2000 characters. Required if no embeds or attachments.
embedsEmbed[]ConditionalArray of embed objects. Max 10 embeds.
attachmentURLsstring[]NoFile attachment URLs. Max 5 items.
linkButtonsLinkButton[]NoExternal link buttons. Max 5 buttons.
roleButtonsRoleButton[]NoRole assignment buttons. Max 5 buttons. Guild-specific.
customCommandButtonsCustomCommandButton[]NoCustom command trigger buttons. Max 5 buttons. Guild-specific.
customCommandElementsSelectOption[]NoCustom command select menu options. Max 25 options. Guild-specific.
roleElementRoleElementNoRole selection dropdown menu. Guild-specific.
dynamicImageDynamicImageNoDynamic image generation configuration.

At least one of content, embeds, or attachmentURLs must be non-empty.


Embed Structure

Each embed in the embeds array:

FieldTypeRequiredConstraints
titlestringNoMax 256 characters
descriptionstringNoMax 4096 characters
colorstringNoHex color code (e.g., "#99AAB5"). Defaults to #99AAB5.
imageURLstringNoURL or parameter placeholder (e.g., {parameter})
thumbnailURLstringNoURL or parameter placeholder
fieldsEmbedField[]NoArray of field objects
authorEmbedAuthorNoAuthor metadata
footerEmbedFooterNoFooter metadata

Total character count across all fields in all embeds must not exceed 6000.

EmbedField

{
"name": "Field Name",
"value": "Field value text",
"inline": false
}
FieldTypeConstraints
namestringMax 256 characters. Required.
valuestringMax 4096 characters. Required.
inlinebooleanDefault false.

EmbedAuthor

{
"name": "Author Name",
"url": "https://example.com",
"imageURL": "https://example.com/avatar.png"
}
FieldTypeConstraints
namestringMax 256 characters
urlstringMust be a valid URL if provided
imageURLstringURL or parameter placeholder

EmbedFooter

{
"text": "Footer text",
"iconURL": "https://example.com/icon.png",
"hideTime": false,
"disabled": false
}
FieldTypeConstraints
textstringMax 2048 characters
iconURLstringURL
hideTimebooleanControls timestamp visibility
disabledbooleanHides entire footer

Button Structures

LinkButton

External URL buttons. Requires allowLinkButtons context.

{
"label": "Visit Website",
"url": "https://example.com",
"emoji": "🔗"
}
FieldTypeConstraints
labelstringMax 80 characters. Required.
urlstringValid HTTPS URL or parameter. Required.
emojistringSingle emoji. Optional.

RoleButton

Role assignment buttons. Requires allowSelfRoles context and guild role data.

{
"id": "123456789",
"label": "Get Role",
"type": "t",
"style": "PRIMARY",
"emoji": "✅"
}
FieldTypeConstraints
idstringDiscord role ID. Required.
labelstringMax 80 characters. Required.
typestring"a" (add), "r" (remove), or "t" (toggle). Required.
stylestring"PRIMARY", "SECONDARY", "SUCCESS", or "DANGER". Required.
emojistringSingle emoji. Optional.

CustomCommandButton

{
"id": "command-button-id",
"label": "Run Command",
"style": "PRIMARY",
"emoji": "⚡"
}
FieldTypeConstraints
idstringCommand button click ID. Required. Must be an enabled BUTTON-type custom command.
labelstringMax 80 characters. Required.
stylestring"PRIMARY", "SECONDARY", "SUCCESS", or "DANGER". Required.
emojistringSingle emoji. Optional.

Select Element Structures

RoleElement

A dropdown menu for role selection.

{
"roles": [
{ "id": "123456789", "label": "Cool Role", "description": "A cool role", "emoji": "⭐" }
],
"placeholder": "Select a role...",
"minValue": 1,
"maxValue": 1
}
FieldTypeConstraints
rolesRoleOption[]Max 25 items. Each must have id and label.
placeholderstringMax 150 characters. Optional.
minValuenumberMinimum roles to select. Must be <=<= maxValue.
maxValuenumberMaximum roles to select. Must be <=<= roles array length.

SelectOption (Custom Command Elements)

{
"id": "command-button-id",
"label": "Option Name",
"description": "What this option does",
"emoji": "🎮"
}
FieldTypeConstraints
idstringCommand button click ID. Required.
labelstringMax 80 characters. Required.
descriptionstringMax 80 characters. Optional.
emojistringSingle emoji. Optional.

Validation Summary

  • At least one of content, embeds, or attachmentURLs must be non-empty
  • Max 10 embeds per message
  • Total embed character count <=<= 6000
  • Max 5 link buttons, 5 role buttons, 5 custom command buttons
  • Max 25 select menu options (role element and custom command elements)
  • All URLs must be valid HTTPS URLs or parameter placeholders

Shared Marketplace Content

When V3 messages are used in shared marketplace content:

  • roleButtons, roleElement, customCommandButtons, and customCommandElements should not be used (they reference guild-specific IDs)
  • linkButtons are supported
  • attachmentURLs are supported
  • dynamicImage is not supported in shared content