Formatter: {
blockQuote(content: string): string;
bold(content: string): `**${string}**`;
channelLink(channelId: string, guildId?: string): string;
channelMention(channelId: string): `<#${string}>`;
codeBlock(content: string, language?: string): string;
emojiMention(
emojiId: string,
name: string | null,
animated?: boolean,
): string;
generateOAuth2URL(applicationId: string, options: OAuth2URLOptions): string;
header(content: string, level?: HeadingLevel): string;
hyperlink(content: string, url: string): `[${string}](${string})`;
inlineCode(content: string): ``${string}``;
italic(content: string): `*${string}*`;
list(items: string[], ordered?: boolean): string;
messageLink(
guildId: string,
channelId: string,
messageId: string,
): `https://discord.com/channels/${string}/${string}/${string}`;
quote(content: string): string;
roleMention(roleId: string): `<@&${string}>`;
spoiler(content: string): `||${string}||`;
strikeThrough(content: string): `~~${string}~~`;
timestamp(
timestamp: Date,
style?: TimestampStyle,
):
| `<t:${number}:t>`
| `<t:${number}:T>`
| `<t:${number}:d>`
| `<t:${number}:D>`
| `<t:${number}:f>`
| `<t:${number}:F>`
| `<t:${number}:R>`;
underline(content: string): `__${string}__`;
userMention(userId: string): `<@${string}>`;
} = ...
Type Declaration
blockQuote: function
blockQuote(content: string): string Returns string
The formatted content.
bold: function
bold(content: string): `**${string}**` Returns `**${string}**`
The formatted content.
channelLink: function
channelLink(channelId: string, guildId?: string): string Parameters
- channelId: string
OptionalguildId: string
Returns string
The formatted channel link.
channelMention: function
channelMention(channelId: string): `<#${string}>` Returns `<#${string}>`
The formatted channel mention.
codeBlock: function
codeBlock(content: string, language?: string): string Parameters
- content: string
- language: string = 'txt'
Returns string
The formatted code block.
emojiMention: function
emojiMention(emojiId: string, name: string | null, animated?: boolean): string Parameters
- emojiId: string
- name: string | null
- animated: boolean = false
Returns string
The formatted emoji.
generateOAuth2URL: function
generateOAuth2URL(applicationId: string, options: OAuth2URLOptions): string Parameters
- applicationId: string
- options: OAuth2URLOptions
scopes
disableGuildSelect
permissions
Returns string
Parameters
- content: string
- level: HeadingLevel = HeadingLevel.H1
Returns string
The formatted header.
hyperlink: function
hyperlink(content: string, url: string): `[${string}](${string})` Parameters
- content: string
- url: string
Returns `[${string}](${string})`
The formatted content.
inlineCode: function
inlineCode(content: string): ``${string}`` Returns ``${string}``
The formatted content.
italic: function
italic(content: string): `*${string}*` Returns `*${string}*`
The formatted content.
list: function
list(items: string[], ordered?: boolean): string Parameters
- items: string[]
- ordered: boolean = false
Returns string
The formatted list.
messageLink: function
messageLink( guildId: string, channelId: string, messageId: string,): `https://discord.com/channels/${string}/${string}/${string}` Parameters
- guildId: string
- channelId: string
- messageId: string
Returns `https://discord.com/channels/${string}/${string}/${string}`
The formatted message link.
quote: function
quote(content: string): string Returns string
The formatted content.
roleMention: function
roleMention(roleId: string): `<@&${string}>` Returns `<@&${string}>`
The formatted role mention.
spoiler: function
spoiler(content: string): `||${string}||` Returns `||${string}||`
The formatted content.
strikeThrough: function
strikeThrough(content: string): `~~${string}~~` Returns `~~${string}~~`
The formatted content.
timestamp: function
timestamp( timestamp: Date, style?: TimestampStyle,): | `<t:${number}:t>` | `<t:${number}:T>` | `<t:${number}:d>` | `<t:${number}:D>` | `<t:${number}:f>` | `<t:${number}:F>` | `<t:${number}:R>` Parameters
- timestamp: Date
- style: TimestampStyle = TimestampStyle.RelativeTime
Returns
| `<t:${number}:t>`
| `<t:${number}:T>`
| `<t:${number}:d>`
| `<t:${number}:D>`
| `<t:${number}:f>`
| `<t:${number}:F>`
| `<t:${number}:R>`
The formatted timestamp.
underline: function
underline(content: string): `__${string}__` Returns `__${string}__`
The formatted content.
userMention: function
userMention(userId: string): `<@${string}>` Returns `<@${string}>`
The formatted user mention.
Represents a formatter utility for formatting content.