Formatting
constFormatting:object
Defined in: package/src/utils/formatting.ts:2
Utilities for formatting text with Discord
Type Declaration
Section titled “Type Declaration”blockQuote()
Section titled “blockQuote()”blockQuote: (
text) =>`>>> ${string}`
Format text as a full block quote covering multiple lines
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`>>> ${string}`
bold()
Section titled “bold()”bold: (
text) =>`**${string}**`
Format text as bold
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`**${string}**`
code()
Section titled “code()”code: (
text) =>${string}
Format text as inline code
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns” ${string}
codeBlock()
Section titled “codeBlock()”codeBlock: (
text,language?) =>````${string} ${string} ````
console.log("Format text as a code block, with optional programming language");Parameters
Section titled “Parameters”string
language?
Section titled “language?”string
Returns
Section titled “Returns”````${string} ${string} ````
footer()
Section titled “footer()”footer: (
text) =>`-# ${string}`
Format text as a small gray footer
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`-# ${string}`
h1: (
text) =>`# ${string}`
Format text as an h1 header (largest)
Section titled “Format text as an h1 header (largest)”Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`# ${string}`
h2: (
text) =>`## ${string}`
Format text as an h2 header (medium)
Section titled “Format text as an h2 header (medium)”Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`## ${string}`
h3: (
text) =>`### ${string}`
Format text as an h3 header (smallest)
Section titled “Format text as an h3 header (smallest)”Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`### ${string}`
italic()
Section titled “italic()”italic: (
text) =>`*${string}*`
Format text as italic
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`*${string}*`
quote()
Section titled “quote()”quote: (
text) =>`> ${string}`
Format text as a quote
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`> ${string}`
strikethrough()
Section titled “strikethrough()”strikethrough: (
text) =>`~~${string}~~`
Format text as a strikethrough
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`~~${string}~~`
underline()
Section titled “underline()”underline: (
text) =>`__${string}__`
Format text to be underlined
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”`__${string}__`