Text Display
type: 10
Messages
Modals
Preview payload.json
Preview modal.json
The Text Display shows markdown-formatted text, just like a regular message. In V2 messages it’s how you write text, since content isn’t allowed.
{ "flags": 32768, "components": [ { "type": 10, "content": "# Big heading\n## Medium heading\n### Small heading\nText with **bold**, *italics*, __underline__, ~~strikethrough~~ and `code`.\n- Bullet lists\n- Mentions: <@123456789012345678> and <#123456789012345678>\n> A quote\n-# Small subtext with a [link](https://discord.com)" } ]}Fields
Section titled “Fields”| Field | Type | Description |
|---|---|---|
type |
integer | required Always 10. |
id |
integer | optional Unique identifier. |
content |
string | required The markdown text. |
Markdown cheat sheet
Section titled “Markdown cheat sheet”| You write | Result |
|---|---|
**bold** |
bold |
*italics* or _italics_ |
italics |
__underline__ |
underline |
~~strikethrough~~ |
|
`code` |
code |
# , ## , ### |
Headings in 3 sizes |
-# text |
Small grey subtext |
> quote |
Quote |
- item |
List |
[text](https://...) |
Link |
||spoiler|| |
Hidden text |
<@ID>, <@&ID>, <#ID> |
User, role or channel mention |
<t:1793620800:R> |
Relative date (“2 hours ago”) |
Mentions
Section titled “Mentions”Mentions inside a Text Display notify people just like in a regular message. Control who gets notified with allowed_mentions:
{ "flags": 32768, "allowed_mentions": { "parse": [] }, "components": [ { "type": 10, "content": "Hi <@123456789012345678>, this won't notify you." } ]}{ "type": 10, "content": "## Hello\nThis is **markdown**." }import { TextDisplayBuilder, MessageFlags } from 'discord.js';
const text = new TextDisplayBuilder().setContent('## Hello\nThis is **markdown**.');await channel.send({ flags: MessageFlags.IsComponentsV2, components: [text] });view = discord.ui.LayoutView()view.add_item(discord.ui.TextDisplay("## Hello\nThis is **markdown**."))await channel.send(view=view)s.ChannelMessageSendComplex(channelID, &discordgo.MessageSend{ Flags: discordgo.MessageFlagsIsComponentsV2, Components: []discordgo.MessageComponent{ discordgo.TextDisplay{Content: "## Hello\nThis is **markdown**."}, },})In modals
Section titled “In modals”In a modal, a Text Display shows instructions between fields. It doesn’t collect data.
Before you join
Read the server rules and answer honestly.
How did you find us?*
{ "type": 9, "data": { "custom_id": "rules", "title": "Before you join", "components": [ { "type": 10, "content": "Read the server **rules** and answer honestly." }, { "type": 18, "label": "How did you find us?", "component": { "type": 4, "custom_id": "source", "style": 1 } } ] }}