Skip to content

File

type: 13 Messages

The File component shows one attachment (PDF, ZIP, text…) at the position you choose inside the message.

Preview
My BotAPPToday at 12:00 PM

📄 Monthly report

Here's the October report.

october-report.pdf
24.5 KB
payload.json
{
"flags": 32768,
"components": [
{
"type": 17,
"components": [
{
"type": 10,
"content": "### 📄 Monthly report\nHere's the October report."
},
{
"type": 13,
"file": {
"url": "attachment://october-report.pdf"
}
}
]
}
]
}
Field Type Description
type integer required Always 13.
id integer optional Unique identifier.
file unfurled media item required Only accepts attachment://name.
spoiler boolean optional Hide as a spoiler. Defaults to false.
name string API responses only: file name. Ignored when sending.
size integer API responses only: size in bytes. Ignored when sending.
Ventana de terminal
curl -X POST "https://discord.com/api/v10/channels/CHANNEL_ID/messages" \
-H "Authorization: Bot $DISCORD_TOKEN" \
-F 'payload_json={"flags":32768,"components":[{"type":13,"file":{"url":"attachment://october-report.pdf"}}]}' \
-F "files[0][email protected]"