Mensagens ricas
Embeds, botões, menus de seleção e Components V2.
Embeds, botões, menus de seleção e Components V2 seguem o formato do Discord, com as diferenças marcadas como [NEX]. Envie pelas rotas de Mensagens ou como resposta de interação.
Embeds
| Campo | Regra |
|---|---|
type | Só "rich" (ou ausente). |
title | 256 caracteres |
description | 4096 caracteres |
url, image.url, thumbnail.url | http(s), até 2048 caracteres |
color | Inteiro de 0 a 16777215 (0xFFFFFF) |
timestamp | Data válida (ISO 8601) |
footer | text obrigatório (2048) e icon_url |
author | name obrigatório (256), url, icon_url |
fields | Até 25. name (256) e value (1024) não vazios, inline opcional |
| Total | Até 10 embeds e 6000 caracteres somando todos |
video, provider) responde 400.{
"embeds": [{
"title": "Status do servidor",
"description": "Tudo **normal**.",
"color": 5763719,
"fields": [{ "name": "Uptime", "value": "99,9%", "inline": true }],
"footer": { "text": "Atualizado agora" },
"timestamp": "2026-10-05T14:00:00Z"
}]
}Componentes
Na raiz só entram Action Rows (type: 1). Cada linha tem até 5 botões ou 1 menu de seleção. No máximo 40 componentes por mensagem, contando todos os níveis.
| type | Componente | Campos |
|---|---|---|
| 1 | Action Row | components[] |
| 2 | Button | style 1–5, label (1–80) e/ou emoji, custom_id (1–100) ou url no estilo 5, disabled |
| 3 | String Select | custom_id, placeholder (150), min_values/max_values (até 25), options 1–25 de { label, value, description?, default? } |
| 5 / 6 / 8 | User / Role / Channel Select | Como o String Select, sem options. Channel aceita channel_types: text, voice, forum |
Estilos de botão: 1 Primary, 2 Secondary, 3 Success, 4 Danger, 5 Link. Botão de link abre a URL direto e nunca gera interação.
{
"content": "Escolha:",
"components": [
{ "type": 1, "components": [
{ "type": 2, "style": 1, "label": "Continuar", "custom_id": "continuar" },
{ "type": 2, "style": 5, "label": "Site", "url": "https://nexapp.online" }
]},
{ "type": 1, "components": [
{ "type": 3, "custom_id": "modo", "options": [
{ "label": "Normal", "value": "normal" },
{ "label": "Repetir", "value": "loop" }
]}
]}
]
}Components V2
Com flags: 32768 a mensagem inteira vira componentes: content e embeds devem estar vazios.
| type | Componente | Regras |
|---|---|---|
| 17 | Container | Raiz. 1–10 filhos dos tipos 9, 10, 12, 13 e 14. |
| 9 | Section | Dentro de Container. 1–3 Text Display + accessory obrigatório (Button ou Thumbnail). |
| 10 | Text Display | content em Markdown, 1–4000. Raiz ou Container. |
| 11 | Thumbnail | Só como accessory de Section. media.url, description (1024), spoiler. |
| 12 | Media Gallery | 1–10 itens com media.url. Raiz ou Container. |
| 13 | File | file.url. Raiz ou Container. |
| 14 | Separator | Sem campos. Raiz ou Container. |
| 1 | Action Row | Só na raiz (fora do Container). |
{
"flags": 32768,
"components": [
{ "type": 17, "components": [
{ "type": 10, "content": "# Bem-vindo!\nMensagem feita só de componentes." },
{ "type": 12, "items": [{ "media": { "url": "https://exemplo.com/banner.png" } }] }
]},
{ "type": 1, "components": [
{ "type": 2, "style": 3, "label": "Dizer oi", "custom_id": "oi" }
]}
]
}Cliques
Quando alguém clica num botão ou escolhe num menu, o NEX valida (mensagem e componente existem na versão atual, componente habilitado, app com o intent interactions.receive, pessoa com VER_CANAL) e entrega uma interação kind: "component" para o seu bot. Responda como em Interações.
409.