Skip to content

Commit f269a0e

Browse files
authored
New message formatting (emails and phone numbers) (#7657)
* add phone, email; add timestamp footnote * improve timestamp style footnote * more details in footnote * URIs not URLs * reword
1 parent cbbd76c commit f269a0e

File tree

1 file changed

+22
-18
lines changed

1 file changed

+22
-18
lines changed

docs/reference.mdx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -259,28 +259,32 @@ Discord utilizes a subset of markdown for rendering message content on its clien
259259

260260
###### Formats
261261

262-
| Type | Structure | Example |
263-
|-------------------------|-----------------------|---------------------------------|
264-
| User | `<@USER_ID>` | `<@80351110224678912>` |
265-
| User \* | `<@!USER_ID>` | `<@!80351110224678912>` |
266-
| Channel | `<#CHANNEL_ID>` | `<#103735883630395392>` |
267-
| Role | `<@&ROLE_ID>` | `<@&165511591545143296>` |
268-
| Slash Command \*\* | `</NAME:COMMAND_ID>` | `</airhorn:816437322781949972>` |
269-
| Standard Emoji | Unicode Characters | 🦶 |
270-
| Custom Emoji | `<:NAME:ID>` | `<:mmLol:216154654256398347>` |
271-
| Custom Emoji (Animated) | `<a:NAME:ID>` | `<a:b1nzy:392938283556143104>` |
272-
| Unix Timestamp | `<t:TIMESTAMP>` | `<t:1618953630>` |
273-
| Unix Timestamp (Styled) | `<t:TIMESTAMP:STYLE>` | `<t:1618953630:d>` |
274-
| Guild Navigation | `<id:TYPE>` | `<id:customize>` |
275-
276-
Using the markdown for either users, roles, or channels will usually mention the target(s) accordingly, but this can be suppressed using the `allowed_mentions` parameter when creating a message. Standard emoji are currently rendered using [Twemoji](https://github.com/jdecked/twemoji) for Desktop/Android and Apple's native emoji on iOS.
277-
278-
Timestamps are expressed in seconds and display the given timestamp in the user's timezone and locale.
262+
| Type | Structure | Example |
263+
|--------------------------------|-----------------------|---------------------------------|
264+
| User | `<@USER_ID>` | `<@80351110224678912>` |
265+
| User \* | `<@!USER_ID>` | `<@!80351110224678912>` |
266+
| Channel | `<#CHANNEL_ID>` | `<#103735883630395392>` |
267+
| Role | `<@&ROLE_ID>` | `<@&165511591545143296>` |
268+
| Slash Command \*\* | `</NAME:COMMAND_ID>` | `</airhorn:816437322781949972>` |
269+
| Standard Emoji | Unicode Characters | 🦶 |
270+
| Custom Emoji | `<:NAME:ID>` | `<:mmLol:216154654256398347>` |
271+
| Custom Emoji (Animated) | `<a:NAME:ID>` | `<a:b1nzy:392938283556143104>` |
272+
| Unix Timestamp \*\*\* | `<t:TIMESTAMP>` | `<t:1618953630>` |
273+
| Unix Timestamp (Styled) \*\*\* | `<t:TIMESTAMP:STYLE>` | `<t:1618953630:d>` |
274+
| Guild Navigation | `<id:TYPE>` | `<id:customize>` |
275+
| Email \*\*\*\* | `<USERNAME@DOMAIN>` | `<[email protected]>` |
276+
| Phone Number \*\*\*\* | `<+PHONE_NUMBER>` | `<+1 (555) 123 4567>` |
277+
278+
Using the markdown for either users, roles, or channels will usually mention the target(s) accordingly, but this can be suppressed using the [`allowed_mentions`](/docs/resources/message#message-object) parameter (when creating a message). Standard emoji are currently rendered using [Twemoji](https://github.com/jdecked/twemoji) for Desktop/Android and Apple's native emoji on iOS.
279279

280280
\* User mentions with an exclamation mark are deprecated and should be handled like any other user mention.
281281

282282
\*\* Subcommands and subcommand groups can also be mentioned by using respectively `</NAME SUBCOMMAND:ID>` and `</NAME SUBCOMMAND_GROUP SUBCOMMAND:ID>`.
283283

284+
\*\*\* Timestamps are expressed in seconds and display the given timestamp in the user's timezone and locale.
285+
286+
\*\*\*\* Email and phone number markdown uses `mailto:` and `tel:` URI schemes respectively that can optionally be prefixed (e.g. `<mailto:[email protected]>`). Email markdown supports headers, values must be [URL Encoded](https://en.wikipedia.org/wiki/Percent-encoding) (e.g. `<[email protected]?subject=Message%20Title&body=Message%20Content>`).
287+
284288
###### Timestamp Styles
285289

286290
| Style | Example Output | Description |
@@ -293,7 +297,7 @@ Timestamps are expressed in seconds and display the given timestamp in the user'
293297
| F | Tuesday, 20 April 2021 16:20 | Long Date/Time |
294298
| R | 2 months ago | Relative Time |
295299

296-
\*default
300+
\* Default style used when no style is specified.
297301

298302
###### Guild Navigation Types
299303

0 commit comments

Comments
 (0)