Ir al contenido

File

type: 13 Mensajes

El componente File muestra un archivo adjunto (PDF, ZIP, texto…) en la posición que tú elijas dentro del mensaje.

Vista previa
Mi BotAPPHoy a las 12:00

📄 Informe mensual

Aquí tienes el informe de octubre.

informe-octubre.pdf
24.5 KB
payload.json
{
"flags": 32768,
"components": [
{
"type": 17,
"components": [
{
"type": 10,
"content": "### 📄 Informe mensual\nAquí tienes el informe de octubre."
},
{
"type": 13,
"file": {
"url": "attachment://informe-octubre.pdf"
}
}
]
}
]
}
Campo Tipo Descripción
type entero obligatorio Siempre 13.
id entero opcional Identificador único.
file unfurled media item obligatorio Solo admite attachment://nombre.
spoiler booleano opcional Ocultar como spoiler. Por defecto false.
name string Solo en respuestas de la API: nombre del archivo. Se ignora al enviar.
size entero Solo en respuestas de la API: tamaño en bytes. Se ignora al enviar.
Ventana de terminal
curl -X POST "https://discord.com/api/v10/channels/ID_DEL_CANAL/messages" \
-H "Authorization: Bot $DISCORD_TOKEN" \
-F 'payload_json={"flags":32768,"components":[{"type":13,"file":{"url":"attachment://informe-octubre.pdf"}}]}' \
-F "files[0]=@informe-octubre.pdf"