@discordjs/formatters 1.0.0-dev.1755777696-4b6060dcd → 1.0.0-dev.1756252914-50018979e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +23 -1
- package/dist/index.d.ts +23 -1
- package/dist/index.js +22 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +20 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -574,6 +574,28 @@ declare function applicationDirectory<ApplicationId extends Snowflake>(applicati
|
|
|
574
574
|
* @param skuId - The SKU id
|
|
575
575
|
*/
|
|
576
576
|
declare function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(applicationId: ApplicationId, skuId: SKUId): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;
|
|
577
|
+
/**
|
|
578
|
+
* Formats an email address into an email mention.
|
|
579
|
+
*
|
|
580
|
+
* @typeParam Email - This is inferred by the supplied email address
|
|
581
|
+
* @param email - The email address to format
|
|
582
|
+
*/
|
|
583
|
+
declare function email<Email extends string>(email: Email): `<${Email}>`;
|
|
584
|
+
/**
|
|
585
|
+
* Formats an email address and headers into an email mention.
|
|
586
|
+
*
|
|
587
|
+
* @typeParam Email - This is inferred by the supplied email address
|
|
588
|
+
* @param email - The email address to format
|
|
589
|
+
* @param headers - Optional headers to include in the email mention
|
|
590
|
+
*/
|
|
591
|
+
declare function email<Email extends string>(email: Email, headers: Record<string, string | readonly string[]> | undefined): `<${Email}?${string}>`;
|
|
592
|
+
/**
|
|
593
|
+
* Formats a phone number into a phone number mention.
|
|
594
|
+
*
|
|
595
|
+
* @typeParam PhoneNumber - This is inferred by the supplied phone number
|
|
596
|
+
* @param phoneNumber - The phone number to format. Must start with a `+` sign.
|
|
597
|
+
*/
|
|
598
|
+
declare function phoneNumber<PhoneNumber extends `+${string}`>(phoneNumber: PhoneNumber): `<${PhoneNumber}>`;
|
|
577
599
|
/**
|
|
578
600
|
* The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}
|
|
579
601
|
* supported by Discord.
|
|
@@ -673,4 +695,4 @@ declare enum GuildNavigationMentions {
|
|
|
673
695
|
*/
|
|
674
696
|
declare const version: string;
|
|
675
697
|
|
|
676
|
-
export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, linkedRoleMention, messageLink, orderedList, quote, roleMention, spoiler, strikethrough, subtext, time, underline, unorderedList, userMention, version };
|
|
698
|
+
export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, email, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, linkedRoleMention, messageLink, orderedList, phoneNumber, quote, roleMention, spoiler, strikethrough, subtext, time, underline, unorderedList, userMention, version };
|
package/dist/index.d.ts
CHANGED
|
@@ -574,6 +574,28 @@ declare function applicationDirectory<ApplicationId extends Snowflake>(applicati
|
|
|
574
574
|
* @param skuId - The SKU id
|
|
575
575
|
*/
|
|
576
576
|
declare function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(applicationId: ApplicationId, skuId: SKUId): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;
|
|
577
|
+
/**
|
|
578
|
+
* Formats an email address into an email mention.
|
|
579
|
+
*
|
|
580
|
+
* @typeParam Email - This is inferred by the supplied email address
|
|
581
|
+
* @param email - The email address to format
|
|
582
|
+
*/
|
|
583
|
+
declare function email<Email extends string>(email: Email): `<${Email}>`;
|
|
584
|
+
/**
|
|
585
|
+
* Formats an email address and headers into an email mention.
|
|
586
|
+
*
|
|
587
|
+
* @typeParam Email - This is inferred by the supplied email address
|
|
588
|
+
* @param email - The email address to format
|
|
589
|
+
* @param headers - Optional headers to include in the email mention
|
|
590
|
+
*/
|
|
591
|
+
declare function email<Email extends string>(email: Email, headers: Record<string, string | readonly string[]> | undefined): `<${Email}?${string}>`;
|
|
592
|
+
/**
|
|
593
|
+
* Formats a phone number into a phone number mention.
|
|
594
|
+
*
|
|
595
|
+
* @typeParam PhoneNumber - This is inferred by the supplied phone number
|
|
596
|
+
* @param phoneNumber - The phone number to format. Must start with a `+` sign.
|
|
597
|
+
*/
|
|
598
|
+
declare function phoneNumber<PhoneNumber extends `+${string}`>(phoneNumber: PhoneNumber): `<${PhoneNumber}>`;
|
|
577
599
|
/**
|
|
578
600
|
* The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}
|
|
579
601
|
* supported by Discord.
|
|
@@ -673,4 +695,4 @@ declare enum GuildNavigationMentions {
|
|
|
673
695
|
*/
|
|
674
696
|
declare const version: string;
|
|
675
697
|
|
|
676
|
-
export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, linkedRoleMention, messageLink, orderedList, quote, roleMention, spoiler, strikethrough, subtext, time, underline, unorderedList, userMention, version };
|
|
698
|
+
export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, email, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, linkedRoleMention, messageLink, orderedList, phoneNumber, quote, roleMention, spoiler, strikethrough, subtext, time, underline, unorderedList, userMention, version };
|
package/dist/index.js
CHANGED
|
@@ -32,6 +32,7 @@ __export(index_exports, {
|
|
|
32
32
|
channelMention: () => channelMention,
|
|
33
33
|
chatInputApplicationCommandMention: () => chatInputApplicationCommandMention,
|
|
34
34
|
codeBlock: () => codeBlock,
|
|
35
|
+
email: () => email,
|
|
35
36
|
escapeBold: () => escapeBold,
|
|
36
37
|
escapeBulletedList: () => escapeBulletedList,
|
|
37
38
|
escapeCodeBlock: () => escapeCodeBlock,
|
|
@@ -54,6 +55,7 @@ __export(index_exports, {
|
|
|
54
55
|
linkedRoleMention: () => linkedRoleMention,
|
|
55
56
|
messageLink: () => messageLink,
|
|
56
57
|
orderedList: () => orderedList,
|
|
58
|
+
phoneNumber: () => phoneNumber,
|
|
57
59
|
quote: () => quote,
|
|
58
60
|
roleMention: () => roleMention,
|
|
59
61
|
spoiler: () => spoiler,
|
|
@@ -344,6 +346,23 @@ function applicationDirectory(applicationId, skuId) {
|
|
|
344
346
|
return skuId ? `${url}/${skuId}` : url;
|
|
345
347
|
}
|
|
346
348
|
__name(applicationDirectory, "applicationDirectory");
|
|
349
|
+
function email(email2, headers) {
|
|
350
|
+
if (headers) {
|
|
351
|
+
const searchParams = new URLSearchParams(
|
|
352
|
+
Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value]))
|
|
353
|
+
);
|
|
354
|
+
return `<${email2}?${searchParams.toString()}>`;
|
|
355
|
+
}
|
|
356
|
+
return `<${email2}>`;
|
|
357
|
+
}
|
|
358
|
+
__name(email, "email");
|
|
359
|
+
function phoneNumber(phoneNumber2) {
|
|
360
|
+
if (!phoneNumber2.startsWith("+")) {
|
|
361
|
+
throw new Error('Phone number must start with a "+" sign.');
|
|
362
|
+
}
|
|
363
|
+
return `<${phoneNumber2}>`;
|
|
364
|
+
}
|
|
365
|
+
__name(phoneNumber, "phoneNumber");
|
|
347
366
|
var TimestampStyles = {
|
|
348
367
|
/**
|
|
349
368
|
* Short time format, consisting of hours and minutes.
|
|
@@ -403,7 +422,7 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
|
|
|
403
422
|
})(GuildNavigationMentions || {});
|
|
404
423
|
|
|
405
424
|
// src/index.ts
|
|
406
|
-
var version = "1.0.0-dev.
|
|
425
|
+
var version = "1.0.0-dev.1756252914-50018979e";
|
|
407
426
|
// Annotate the CommonJS export names for ESM import in node:
|
|
408
427
|
0 && (module.exports = {
|
|
409
428
|
Faces,
|
|
@@ -417,6 +436,7 @@ var version = "1.0.0-dev.1755777696-4b6060dcd";
|
|
|
417
436
|
channelMention,
|
|
418
437
|
chatInputApplicationCommandMention,
|
|
419
438
|
codeBlock,
|
|
439
|
+
email,
|
|
420
440
|
escapeBold,
|
|
421
441
|
escapeBulletedList,
|
|
422
442
|
escapeCodeBlock,
|
|
@@ -439,6 +459,7 @@ var version = "1.0.0-dev.1755777696-4b6060dcd";
|
|
|
439
459
|
linkedRoleMention,
|
|
440
460
|
messageLink,
|
|
441
461
|
orderedList,
|
|
462
|
+
phoneNumber,
|
|
442
463
|
quote,
|
|
443
464
|
roleMention,
|
|
444
465
|
spoiler,
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/escapers.ts","../src/formatters.ts"],"sourcesContent":["export * from './escapers.js';\nexport * from './formatters.js';\n\n/**\n * The {@link https://github.com/discordjs/discord.js/blob/main/packages/formatters#readme | @discordjs/formatters} version\n * that you are currently using.\n *\n * @privateRemarks This needs to explicitly be `string` so it is not typed as a \"const string\" that gets injected by esbuild.\n */\nexport const version = '1.0.0-dev.1755777696-4b6060dcd' as string;\n","/* eslint-disable prefer-named-capture-group */\n\n/**\n * The options that affect what will be escaped.\n */\nexport interface EscapeMarkdownOptions {\n\t/**\n\t * Whether to escape bold text.\n\t *\n\t * @defaultValue `true`\n\t */\n\tbold?: boolean;\n\n\t/**\n\t * Whether to escape bulleted lists.\n\t *\n\t * @defaultValue `true`\n\t */\n\tbulletedList?: boolean;\n\n\t/**\n\t * Whether to escape code blocks.\n\t *\n\t * @defaultValue `true`\n\t */\n\tcodeBlock?: boolean;\n\n\t/**\n\t * Whether to escape text inside code blocks.\n\t *\n\t * @defaultValue `true`\n\t */\n\tcodeBlockContent?: boolean;\n\n\t/**\n\t * Whether to escape `\\`.\n\t *\n\t * @defaultValue `true`\n\t */\n\tescape?: boolean;\n\n\t/**\n\t * Whether to escape headings.\n\t *\n\t * @defaultValue `true`\n\t */\n\theading?: boolean;\n\n\t/**\n\t * Whether to escape inline code.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinlineCode?: boolean;\n\n\t/**\n\t * Whether to escape text inside inline code.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinlineCodeContent?: boolean;\n\t/**\n\t * Whether to escape italics.\n\t *\n\t * @defaultValue `true`\n\t */\n\titalic?: boolean;\n\n\t/**\n\t * Whether to escape masked links.\n\t *\n\t * @defaultValue `true`\n\t */\n\tmaskedLink?: boolean;\n\n\t/**\n\t * Whether to escape numbered lists.\n\t *\n\t * @defaultValue `true`\n\t */\n\tnumberedList?: boolean;\n\n\t/**\n\t * Whether to escape spoilers.\n\t *\n\t * @defaultValue `true`\n\t */\n\tspoiler?: boolean;\n\n\t/**\n\t * Whether to escape strikethroughs.\n\t *\n\t * @defaultValue `true`\n\t */\n\tstrikethrough?: boolean;\n\n\t/**\n\t * Whether to escape underlines.\n\t *\n\t * @defaultValue `true`\n\t */\n\tunderline?: boolean;\n}\n\n/**\n * Escapes any Discord-flavored markdown in a string.\n *\n * @param text - Content to escape\n * @param options - Options for escaping the markdown\n */\nexport function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}): string {\n\tconst {\n\t\tcodeBlock = true,\n\t\tinlineCode = true,\n\t\tbold = true,\n\t\titalic = true,\n\t\tunderline = true,\n\t\tstrikethrough = true,\n\t\tspoiler = true,\n\t\tcodeBlockContent = true,\n\t\tinlineCodeContent = true,\n\t\tescape = true,\n\t\theading = true,\n\t\tbulletedList = true,\n\t\tnumberedList = true,\n\t\tmaskedLink = true,\n\t} = options;\n\n\tif (!codeBlockContent) {\n\t\treturn text\n\t\t\t.split('```')\n\t\t\t.map((subString, index, array) => {\n\t\t\t\tif (index % 2 && index !== array.length - 1) return subString;\n\t\t\t\treturn escapeMarkdown(subString, {\n\t\t\t\t\tinlineCode,\n\t\t\t\t\tbold,\n\t\t\t\t\titalic,\n\t\t\t\t\tunderline,\n\t\t\t\t\tstrikethrough,\n\t\t\t\t\tspoiler,\n\t\t\t\t\tinlineCodeContent,\n\t\t\t\t\tescape,\n\t\t\t\t\theading,\n\t\t\t\t\tbulletedList,\n\t\t\t\t\tnumberedList,\n\t\t\t\t\tmaskedLink,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.join(codeBlock ? '\\\\`\\\\`\\\\`' : '```');\n\t}\n\n\tif (!inlineCodeContent) {\n\t\treturn text\n\t\t\t.split(/(?<=^|[^`])`(?=[^`]|$)/g)\n\t\t\t.map((subString, index, array) => {\n\t\t\t\tif (index % 2 && index !== array.length - 1) return subString;\n\t\t\t\treturn escapeMarkdown(subString, {\n\t\t\t\t\tcodeBlock,\n\t\t\t\t\tbold,\n\t\t\t\t\titalic,\n\t\t\t\t\tunderline,\n\t\t\t\t\tstrikethrough,\n\t\t\t\t\tspoiler,\n\t\t\t\t\tescape,\n\t\t\t\t\theading,\n\t\t\t\t\tbulletedList,\n\t\t\t\t\tnumberedList,\n\t\t\t\t\tmaskedLink,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.join(inlineCode ? '\\\\`' : '`');\n\t}\n\n\tlet res = text;\n\tif (escape) res = escapeEscape(res);\n\tif (inlineCode) res = escapeInlineCode(res);\n\tif (codeBlock) res = escapeCodeBlock(res);\n\tif (italic) res = escapeItalic(res);\n\tif (bold) res = escapeBold(res);\n\tif (underline) res = escapeUnderline(res);\n\tif (strikethrough) res = escapeStrikethrough(res);\n\tif (spoiler) res = escapeSpoiler(res);\n\tif (heading) res = escapeHeading(res);\n\tif (bulletedList) res = escapeBulletedList(res);\n\tif (numberedList) res = escapeNumberedList(res);\n\tif (maskedLink) res = escapeMaskedLink(res);\n\treturn res;\n}\n\n/**\n * Escapes code block markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeCodeBlock(text: string): string {\n\treturn text.replaceAll('```', '\\\\`\\\\`\\\\`');\n}\n\n/**\n * Escapes inline code markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeInlineCode(text: string): string {\n\treturn text.replaceAll(/(?<=^|[^`])``?(?=[^`]|$)/g, (match) => (match.length === 2 ? '\\\\`\\\\`' : '\\\\`'));\n}\n\n/**\n * Escapes italic markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeItalic(text: string): string {\n\tlet idx = 0;\n\tconst newText = text.replaceAll(/(?<=^|[^*])\\*([^*]|\\*\\*|$)/g, (_, match) => {\n\t\tif (match === '**') return ++idx % 2 ? `\\\\*${match}` : `${match}\\\\*`;\n\t\treturn `\\\\*${match}`;\n\t});\n\tidx = 0;\n\treturn newText.replaceAll(/(?<=^|[^_])(?<!<a?:.+|https?:\\/\\/\\S+)_(?!:\\d+>)([^_]|__|$)/g, (_, match) => {\n\t\tif (match === '__') return ++idx % 2 ? `\\\\_${match}` : `${match}\\\\_`;\n\t\treturn `\\\\_${match}`;\n\t});\n}\n\n/**\n * Escapes bold markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBold(text: string): string {\n\tlet idx = 0;\n\treturn text.replaceAll(/\\*\\*(\\*)?/g, (_, match) => {\n\t\tif (match) return ++idx % 2 ? `${match}\\\\*\\\\*` : `\\\\*\\\\*${match}`;\n\t\treturn '\\\\*\\\\*';\n\t});\n}\n\n/**\n * Escapes underline markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeUnderline(text: string): string {\n\tlet idx = 0;\n\treturn text.replaceAll(/(?<!<a?:.+|https?:\\/\\/\\S+)__(_)?(?!:\\d+>)/g, (_, match) => {\n\t\tif (match) return ++idx % 2 ? `${match}\\\\_\\\\_` : `\\\\_\\\\_${match}`;\n\t\treturn '\\\\_\\\\_';\n\t});\n}\n\n/**\n * Escapes strikethrough markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeStrikethrough(text: string): string {\n\treturn text.replaceAll('~~', '\\\\~\\\\~');\n}\n\n/**\n * Escapes spoiler markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeSpoiler(text: string): string {\n\treturn text.replaceAll('||', '\\\\|\\\\|');\n}\n\n/**\n * Escapes escape characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeEscape(text: string): string {\n\treturn text.replaceAll('\\\\', '\\\\\\\\');\n}\n\n/**\n * Escapes heading characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeHeading(text: string): string {\n\treturn text.replaceAll(/^( {0,2})([*-] )?( *)(#{1,3} )/gm, '$1$2$3\\\\$4');\n}\n\n/**\n * Escapes bulleted list characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBulletedList(text: string): string {\n\treturn text.replaceAll(/^( *)([*-])( +)/gm, '$1\\\\$2$3');\n}\n\n/**\n * Escapes numbered list characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeNumberedList(text: string): string {\n\treturn text.replaceAll(/^( *\\d+)\\./gm, '$1\\\\.');\n}\n\n/**\n * Escapes masked link characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeMaskedLink(text: string): string {\n\treturn text.replaceAll(/\\[.+]\\(.+\\)/gm, '\\\\$&');\n}\n","import type { URL } from 'node:url';\nimport type { Snowflake } from 'discord-api-types/globals';\n\n/**\n * Wraps the content inside a code block with no language.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function codeBlock<Content extends string>(content: Content): `\\`\\`\\`\\n${Content}\\n\\`\\`\\``;\n\n/**\n * Wraps the content inside a code block with the specified language.\n *\n * @typeParam Language - This is inferred by the supplied language\n * @typeParam Content - This is inferred by the supplied content\n * @param language - The language for the code block\n * @param content - The content to wrap\n */\nexport function codeBlock<Language extends string, Content extends string>(\n\tlanguage: Language,\n\tcontent: Content,\n): `\\`\\`\\`${Language}\\n${Content}\\n\\`\\`\\``;\n\nexport function codeBlock(language: string, content?: string): string {\n\treturn content === undefined ? `\\`\\`\\`\\n${language}\\n\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\n\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\` which formats it as inline code.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function inlineCode<Content extends string>(content: Content): `\\`${Content}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function italic<Content extends string>(content: Content): `_${Content}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function bold<Content extends string>(content: Content): `**${Content}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underlined text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function underline<Content extends string>(content: Content): `__${Content}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function strikethrough<Content extends string>(content: Content): `~~${Content}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote.\n *\n * @remarks This needs to be at the start of the line for Discord to format it.\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function quote<Content extends string>(content: Content): `> ${Content}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote.\n *\n * @remarks This needs to be at the start of the line for Discord to format it.\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function blockQuote<Content extends string>(content: Content): `>>> ${Content}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>` which stops it from embedding.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param url - The URL to wrap\n */\nexport function hideLinkEmbed<Content extends string>(url: Content): `<${Content}>`;\n\n/**\n * Wraps the URL into `<>` which stops it from embedding.\n *\n * @param url - The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\n\nexport function hideLinkEmbed(url: URL | string) {\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to display\n * @param url - The URL the content links to\n */\nexport function hyperlink<Content extends string>(content: Content, url: URL): `[${Content}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Url - This is inferred by the supplied URL\n * @param content - The content to display\n * @param url - The URL the content links to\n */\nexport function hyperlink<Content extends string, Url extends string>(\n\tcontent: Content,\n\turl: Url,\n): `[${Content}](${Url})`;\n\n/**\n * Formats the content and the URL into a masked URL with a custom tooltip.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Title - This is inferred by the supplied title\n * @param content - The content to display\n * @param url - The URL the content links to\n * @param title - The title shown when hovering on the masked link\n */\nexport function hyperlink<Content extends string, Title extends string>(\n\tcontent: Content,\n\turl: URL,\n\ttitle: Title,\n): `[${Content}](${string} \"${Title}\")`;\n\n/**\n * Formats the content and the URL into a masked URL with a custom tooltip.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Url - This is inferred by the supplied URL\n * @typeParam Title - This is inferred by the supplied title\n * @param content - The content to display\n * @param url - The URL the content links to\n * @param title - The title shown when hovering on the masked link\n */\nexport function hyperlink<Content extends string, Url extends string, Title extends string>(\n\tcontent: Content,\n\turl: Url,\n\ttitle: Title,\n): `[${Content}](${Url} \"${Title}\")`;\n\nexport function hyperlink(content: string, url: URL | string, title?: string) {\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Formats the content into a spoiler.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function spoiler<Content extends string>(content: Content): `||${Content}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user id into a user mention.\n *\n * @typeParam UserId - This is inferred by the supplied user id\n * @param userId - The user id to format\n */\nexport function userMention<UserId extends Snowflake>(userId: UserId): `<@${UserId}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a channel id into a channel mention.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @param channelId - The channel id to format\n */\nexport function channelMention<ChannelId extends Snowflake>(channelId: ChannelId): `<#${ChannelId}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role id into a role mention.\n *\n * @typeParam RoleId - This is inferred by the supplied role id\n * @param roleId - The role id to format\n */\nexport function roleMention<RoleId extends Snowflake>(roleId: RoleId): `<@&${RoleId}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats a role id into a linked role mention.\n *\n * @typeParam RoleId - This is inferred by the supplied role id\n * @param roleId - The role id to format\n */\nexport function linkedRoleMention<RoleId extends Snowflake>(roleId: RoleId): `<id:linked-roles:${RoleId}>` {\n\treturn `<id:linked-roles:${roleId}>`;\n}\n\n/**\n * Formats an application command name and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n */\nexport function chatInputApplicationCommandMention<CommandId extends Snowflake, CommandName extends string>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n): `</${CommandName}:${CommandId}>`;\n\n/**\n * Formats an application command name, subcommand name, and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @typeParam SubcommandName - This is inferred by the supplied subcommand name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n * @param subcommandName - The subcommand name to format\n */\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName: SubcommandName,\n): `</${CommandName} ${SubcommandName}:${CommandId}>`;\n\n/**\n * Formats an application command name, subcommand group name, subcommand name, and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @typeParam SubcommandName - This is inferred by the supplied subcommand name\n * @typeParam SubcommandGroupName - This is inferred by the supplied subcommand group name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n * @param subcommandName - The subcommand name to format\n * @param subcommandGroupName - The subcommand group name to format\n */\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n\tSubcommandGroupName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName: SubcommandName,\n\tsubcommandGroupName: SubcommandGroupName,\n): `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`;\n\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n\tSubcommandGroupName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName?: SubcommandName | undefined,\n\tsubcommandGroupName?: SubcommandGroupName | undefined,\n):\n\t| `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`\n\t| `</${CommandName} ${SubcommandName}:${CommandId}>`\n\t| `</${CommandName}:${CommandId}>` {\n\tif (subcommandGroupName !== undefined && subcommandName !== undefined) {\n\t\treturn `</${commandName} ${subcommandGroupName} ${subcommandName}:${commandId}>`;\n\t}\n\n\tif (subcommandName !== undefined) {\n\t\treturn `</${commandName} ${subcommandName}:${commandId}>`;\n\t}\n\n\treturn `</${commandName}:${commandId}>`;\n}\n\n/**\n * Formats a non-animated emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n */\nexport function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:emoji:${EmojiId}>`;\n\n/**\n * Formats an animated emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n * @param animated - Whether the emoji is animated\n */\nexport function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:emoji:${EmojiId}>`;\n\n/**\n * Formats an emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n * @param animated - Whether the emoji is animated\n */\nexport function formatEmoji<EmojiId extends Snowflake>(\n\temojiId: EmojiId,\n\tanimated?: boolean,\n): `<:emoji:${EmojiId}>` | `<a:emoji:${EmojiId}>`;\n\n/**\n * Formats a non-animated emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName> & { animated: true },\n): `<a:${EmojiName}:${EmojiId}>`;\n\n/**\n * Formats an animated emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName> & { animated?: false },\n): `<:${EmojiName}:${EmojiId}>`;\n\n/**\n * Formats an emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied emoji name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName>,\n): `<:${EmojiName}:${EmojiId}>` | `<a:${EmojiName}:${EmojiId}>`;\n\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\temojiIdOrOptions: EmojiId | FormatEmojiOptions<EmojiId, EmojiName>,\n\tanimated?: boolean,\n): `<:${string}:${EmojiId}>` | `<a:${string}:${EmojiId}>` {\n\tconst options =\n\t\ttypeof emojiIdOrOptions === 'string'\n\t\t\t? {\n\t\t\t\t\tid: emojiIdOrOptions,\n\t\t\t\t\tanimated: animated ?? false,\n\t\t\t\t}\n\t\t\t: emojiIdOrOptions;\n\n\tconst { id, animated: isAnimated, name: emojiName } = options;\n\n\treturn `<${isAnimated ? 'a' : ''}:${emojiName ?? 'emoji'}:${id}>`;\n}\n\n/**\n * The options for formatting an emoji.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied emoji name\n */\nexport interface FormatEmojiOptions<EmojiId extends Snowflake, EmojiName extends string> {\n\t/**\n\t * Whether the emoji is animated\n\t */\n\tanimated?: boolean;\n\t/**\n\t * The emoji id to format\n\t */\n\tid: EmojiId;\n\t/**\n\t * The name of the emoji\n\t */\n\tname?: EmojiName;\n}\n\n/**\n * Formats a channel link for a direct message channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @param channelId - The channel's id\n */\nexport function channelLink<ChannelId extends Snowflake>(\n\tchannelId: ChannelId,\n): `https://discord.com/channels/@me/${ChannelId}`;\n\n/**\n * Formats a channel link for a guild channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam GuildId - This is inferred by the supplied guild id\n * @param channelId - The channel's id\n * @param guildId - The guild's id\n */\nexport function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tguildId: GuildId,\n): `https://discord.com/channels/${GuildId}/${ChannelId}`;\n\nexport function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tguildId?: GuildId,\n): `https://discord.com/channels/@me/${ChannelId}` | `https://discord.com/channels/${GuildId}/${ChannelId}` {\n\treturn `https://discord.com/channels/${guildId ?? '@me'}/${channelId}`;\n}\n\n/**\n * Formats a message link for a direct message channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam MessageId - This is inferred by the supplied message id\n * @param channelId - The channel's id\n * @param messageId - The message's id\n */\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n): `https://discord.com/channels/@me/${ChannelId}/${MessageId}`;\n\n/**\n * Formats a message link for a guild channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam MessageId - This is inferred by the supplied message id\n * @typeParam GuildId - This is inferred by the supplied guild id\n * @param channelId - The channel's id\n * @param messageId - The message's id\n * @param guildId - The guild's id\n */\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n\tguildId: GuildId,\n): `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}`;\n\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n\tguildId?: GuildId,\n):\n\t| `https://discord.com/channels/@me/${ChannelId}/${MessageId}`\n\t| `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}` {\n\treturn `${guildId === undefined ? channelLink(channelId) : channelLink(channelId, guildId)}/${messageId}`;\n}\n\n/**\n * The heading levels for expanded markdown.\n */\nexport enum HeadingLevel {\n\t/**\n\t * The first heading level.\n\t */\n\tOne = 1,\n\t/**\n\t * The second heading level.\n\t */\n\tTwo,\n\t/**\n\t * The third heading level.\n\t */\n\tThree,\n}\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level?: HeadingLevel.One): `# ${Content}`;\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level: HeadingLevel.Two): `## ${Content}`;\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level: HeadingLevel.Three): `### ${Content}`;\n\nexport function heading(content: string, level?: HeadingLevel) {\n\t// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n\tswitch (level) {\n\t\tcase HeadingLevel.Three:\n\t\t\treturn `### ${content}`;\n\t\tcase HeadingLevel.Two:\n\t\t\treturn `## ${content}`;\n\t\tdefault:\n\t\t\treturn `# ${content}`;\n\t}\n}\n\n/**\n * A type that recursively traverses into arrays.\n */\nexport type RecursiveArray<ItemType> = readonly (ItemType | RecursiveArray<ItemType>)[];\n\n/**\n * Callback function for list formatters.\n *\n * @internal\n */\nfunction listCallback(element: RecursiveArray<string>, startNumber?: number, depth = 0): string {\n\tif (Array.isArray(element)) {\n\t\treturn element.map((element) => listCallback(element, startNumber, depth + 1)).join('\\n');\n\t}\n\n\treturn `${' '.repeat(depth - 1)}${startNumber ? `${startNumber}.` : '-'} ${element}`;\n}\n\n/**\n * Formats the elements in the array to an ordered list.\n *\n * @param list - The array of elements to list\n * @param startNumber - The starting number for the list\n */\nexport function orderedList(list: RecursiveArray<string>, startNumber = 1): string {\n\treturn listCallback(list, Math.max(startNumber, 1));\n}\n\n/**\n * Formats the elements in the array to an unordered list.\n *\n * @param list - The array of elements to list\n */\nexport function unorderedList(list: RecursiveArray<string>): string {\n\treturn listCallback(list);\n}\n\n/**\n * Formats the content into a subtext.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function subtext<Content extends string>(content: Content): `-# ${Content}` {\n\treturn `-# ${content}`;\n}\n\n/**\n * Formats a date into a short date-time string.\n *\n * @param date - The date to format. Defaults to the current time\n */\nexport function time(date?: Date): `<t:${bigint}>`;\n\n/**\n * Formats a date given a format style.\n *\n * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}\n * @param date - The date to format\n * @param style - The style to use\n */\nexport function time<Style extends TimestampStylesString>(date: Date, style: Style): `<t:${bigint}:${Style}>`;\n\n/**\n * Formats the given timestamp into a short date-time string.\n *\n * @typeParam Seconds - This is inferred by the supplied timestamp\n * @param seconds - A Unix timestamp in seconds\n */\nexport function time<Seconds extends number>(seconds: Seconds): `<t:${Seconds}>`;\n\n/**\n * Formats the given timestamp into a short date-time string.\n *\n * @typeParam Seconds - This is inferred by the supplied timestamp\n * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}\n * @param seconds - A Unix timestamp in seconds\n * @param style - The style to use\n */\nexport function time<Seconds extends number, Style extends TimestampStylesString>(\n\tseconds: Seconds,\n\tstyle: Style,\n): `<t:${Seconds}:${Style}>`;\n\nexport function time(timeOrSeconds?: Date | number, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1_000);\n\t}\n\n\treturn typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;\n}\n\n/**\n * Formats an application directory link.\n *\n * @typeParam ApplicationId - This is inferred by the supplied application id\n * @param applicationId - The application id\n */\nexport function applicationDirectory<ApplicationId extends Snowflake>(\n\tapplicationId: ApplicationId,\n): `https://discord.com/application-directory/${ApplicationId}/store`;\n\n/**\n * Formats an application directory SKU link.\n *\n * @typeParam ApplicationId - This is inferred by the supplied application id\n * @typeParam SKUId - This is inferred by the supplied SKU id\n * @param applicationId - The application id\n * @param skuId - The SKU id\n */\nexport function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(\n\tapplicationId: ApplicationId,\n\tskuId: SKUId,\n): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;\n\nexport function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(\n\tapplicationId: ApplicationId,\n\tskuId?: SKUId,\n):\n\t| `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`\n\t| `https://discord.com/application-directory/${ApplicationId}/store` {\n\tconst url = `https://discord.com/application-directory/${applicationId}/store` as const;\n\treturn skuId ? `${url}/${skuId}` : url;\n}\n\n/**\n * The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}\n * supported by Discord.\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes.\n\t *\n\t * @example `16:20`\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds.\n\t *\n\t * @example `16:20:30`\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year.\n\t *\n\t * @example `20/04/2021`\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year.\n\t *\n\t * @example `20 April 2021`\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats.\n\t *\n\t * @example `20 April 2021 16:20`\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats.\n\t *\n\t * @example `Tuesday, 20 April 2021 16:20`\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format.\n\t *\n\t * @example `2 months ago`\n\t */\n\tRelativeTime: 'R',\n} as const satisfies Record<string, string>;\n\n/**\n * The possible {@link TimestampStyles} values.\n */\nexport type TimestampStylesString = (typeof TimestampStyles)[keyof typeof TimestampStyles];\n\n/**\n * All the available faces from Discord's native slash commands.\n */\nexport enum Faces {\n\t/**\n\t * `¯\\_(ツ)_/¯`\n\t */\n\tShrug = '¯\\\\_(ツ)_/¯',\n\n\t/**\n\t * `(╯°□°)╯︵ ┻━┻`\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * `┬─┬ノ( º _ ºノ)`\n\t */\n\tUnflip = '┬─┬ノ( º _ ºノ)',\n}\n\n/**\n * All the available guild navigation mentions.\n */\nexport enum GuildNavigationMentions {\n\t/**\n\t * Browse Channels tab.\n\t */\n\tBrowse = '<id:browse>',\n\t/**\n\t * Customize tab with the server's {@link https://discord.com/developers/docs/resources/guild#guild-onboarding-object | onboarding prompts}.\n\t */\n\tCustomize = '<id:customize>',\n\t/**\n\t * {@link https://support.discord.com/hc/articles/13497665141655 | Server Guide} tab.\n\t */\n\tGuide = '<id:guide>',\n\t/**\n\t * {@link https://support.discord.com/hc/articles/10388356626711 | Linked Roles} tab.\n\t */\n\tLinkedRoles = '<id:linked-roles>',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;A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AmC;AAClF,SAAO,MAAM,OAAO;AACrB;AAFgB;AAyCT,SAAS,KAAK,eAA+B,OAAuC;AAC1F,MAAI,OAAO,kBAAkB,UAAU;AAEtC,oBAAgB,KAAK,OAAO,eAAe,QAAQ,KAAK,KAAK,IAAI,KAAK,GAAK;AAAA,EAC5E;AAEA,SAAO,OAAO,UAAU,WAAW,MAAM,aAAa,IAAI,KAAK,MAAM,MAAM,aAAa;AACzF;AAPgB;AAgCT,SAAS,qBACf,eACA,OAGqE;AACrE,QAAM,MAAM,6CAA6C,aAAa;AACtE,SAAO,QAAQ,GAAG,GAAG,IAAI,KAAK,KAAK;AACpC;AARgB;AAcT,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOX,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOV,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOX,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOV,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOd,cAAc;AACf;AAUO,IAAK,QAAL,kBAAKC,WAAL;AAIN,EAAAA,OAAA,WAAQ;AAKR,EAAAA,OAAA,eAAY;AAKZ,EAAAA,OAAA,YAAS;AAdE,SAAAA;AAAA,GAAA;AAoBL,IAAK,0BAAL,kBAAKC,6BAAL;AAIN,EAAAA,yBAAA,YAAS;AAIT,EAAAA,yBAAA,eAAY;AAIZ,EAAAA,yBAAA,WAAQ;AAIR,EAAAA,yBAAA,iBAAc;AAhBH,SAAAA;AAAA,GAAA;;;AF9tBL,IAAM,UAAU;","names":["codeBlock","inlineCode","bold","italic","underline","strikethrough","spoiler","heading","HeadingLevel","element","Faces","GuildNavigationMentions"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/escapers.ts","../src/formatters.ts"],"sourcesContent":["export * from './escapers.js';\nexport * from './formatters.js';\n\n/**\n * The {@link https://github.com/discordjs/discord.js/blob/main/packages/formatters#readme | @discordjs/formatters} version\n * that you are currently using.\n *\n * @privateRemarks This needs to explicitly be `string` so it is not typed as a \"const string\" that gets injected by esbuild.\n */\nexport const version = '1.0.0-dev.1756252914-50018979e' as string;\n","/* eslint-disable prefer-named-capture-group */\n\n/**\n * The options that affect what will be escaped.\n */\nexport interface EscapeMarkdownOptions {\n\t/**\n\t * Whether to escape bold text.\n\t *\n\t * @defaultValue `true`\n\t */\n\tbold?: boolean;\n\n\t/**\n\t * Whether to escape bulleted lists.\n\t *\n\t * @defaultValue `true`\n\t */\n\tbulletedList?: boolean;\n\n\t/**\n\t * Whether to escape code blocks.\n\t *\n\t * @defaultValue `true`\n\t */\n\tcodeBlock?: boolean;\n\n\t/**\n\t * Whether to escape text inside code blocks.\n\t *\n\t * @defaultValue `true`\n\t */\n\tcodeBlockContent?: boolean;\n\n\t/**\n\t * Whether to escape `\\`.\n\t *\n\t * @defaultValue `true`\n\t */\n\tescape?: boolean;\n\n\t/**\n\t * Whether to escape headings.\n\t *\n\t * @defaultValue `true`\n\t */\n\theading?: boolean;\n\n\t/**\n\t * Whether to escape inline code.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinlineCode?: boolean;\n\n\t/**\n\t * Whether to escape text inside inline code.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinlineCodeContent?: boolean;\n\t/**\n\t * Whether to escape italics.\n\t *\n\t * @defaultValue `true`\n\t */\n\titalic?: boolean;\n\n\t/**\n\t * Whether to escape masked links.\n\t *\n\t * @defaultValue `true`\n\t */\n\tmaskedLink?: boolean;\n\n\t/**\n\t * Whether to escape numbered lists.\n\t *\n\t * @defaultValue `true`\n\t */\n\tnumberedList?: boolean;\n\n\t/**\n\t * Whether to escape spoilers.\n\t *\n\t * @defaultValue `true`\n\t */\n\tspoiler?: boolean;\n\n\t/**\n\t * Whether to escape strikethroughs.\n\t *\n\t * @defaultValue `true`\n\t */\n\tstrikethrough?: boolean;\n\n\t/**\n\t * Whether to escape underlines.\n\t *\n\t * @defaultValue `true`\n\t */\n\tunderline?: boolean;\n}\n\n/**\n * Escapes any Discord-flavored markdown in a string.\n *\n * @param text - Content to escape\n * @param options - Options for escaping the markdown\n */\nexport function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}): string {\n\tconst {\n\t\tcodeBlock = true,\n\t\tinlineCode = true,\n\t\tbold = true,\n\t\titalic = true,\n\t\tunderline = true,\n\t\tstrikethrough = true,\n\t\tspoiler = true,\n\t\tcodeBlockContent = true,\n\t\tinlineCodeContent = true,\n\t\tescape = true,\n\t\theading = true,\n\t\tbulletedList = true,\n\t\tnumberedList = true,\n\t\tmaskedLink = true,\n\t} = options;\n\n\tif (!codeBlockContent) {\n\t\treturn text\n\t\t\t.split('```')\n\t\t\t.map((subString, index, array) => {\n\t\t\t\tif (index % 2 && index !== array.length - 1) return subString;\n\t\t\t\treturn escapeMarkdown(subString, {\n\t\t\t\t\tinlineCode,\n\t\t\t\t\tbold,\n\t\t\t\t\titalic,\n\t\t\t\t\tunderline,\n\t\t\t\t\tstrikethrough,\n\t\t\t\t\tspoiler,\n\t\t\t\t\tinlineCodeContent,\n\t\t\t\t\tescape,\n\t\t\t\t\theading,\n\t\t\t\t\tbulletedList,\n\t\t\t\t\tnumberedList,\n\t\t\t\t\tmaskedLink,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.join(codeBlock ? '\\\\`\\\\`\\\\`' : '```');\n\t}\n\n\tif (!inlineCodeContent) {\n\t\treturn text\n\t\t\t.split(/(?<=^|[^`])`(?=[^`]|$)/g)\n\t\t\t.map((subString, index, array) => {\n\t\t\t\tif (index % 2 && index !== array.length - 1) return subString;\n\t\t\t\treturn escapeMarkdown(subString, {\n\t\t\t\t\tcodeBlock,\n\t\t\t\t\tbold,\n\t\t\t\t\titalic,\n\t\t\t\t\tunderline,\n\t\t\t\t\tstrikethrough,\n\t\t\t\t\tspoiler,\n\t\t\t\t\tescape,\n\t\t\t\t\theading,\n\t\t\t\t\tbulletedList,\n\t\t\t\t\tnumberedList,\n\t\t\t\t\tmaskedLink,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.join(inlineCode ? '\\\\`' : '`');\n\t}\n\n\tlet res = text;\n\tif (escape) res = escapeEscape(res);\n\tif (inlineCode) res = escapeInlineCode(res);\n\tif (codeBlock) res = escapeCodeBlock(res);\n\tif (italic) res = escapeItalic(res);\n\tif (bold) res = escapeBold(res);\n\tif (underline) res = escapeUnderline(res);\n\tif (strikethrough) res = escapeStrikethrough(res);\n\tif (spoiler) res = escapeSpoiler(res);\n\tif (heading) res = escapeHeading(res);\n\tif (bulletedList) res = escapeBulletedList(res);\n\tif (numberedList) res = escapeNumberedList(res);\n\tif (maskedLink) res = escapeMaskedLink(res);\n\treturn res;\n}\n\n/**\n * Escapes code block markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeCodeBlock(text: string): string {\n\treturn text.replaceAll('```', '\\\\`\\\\`\\\\`');\n}\n\n/**\n * Escapes inline code markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeInlineCode(text: string): string {\n\treturn text.replaceAll(/(?<=^|[^`])``?(?=[^`]|$)/g, (match) => (match.length === 2 ? '\\\\`\\\\`' : '\\\\`'));\n}\n\n/**\n * Escapes italic markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeItalic(text: string): string {\n\tlet idx = 0;\n\tconst newText = text.replaceAll(/(?<=^|[^*])\\*([^*]|\\*\\*|$)/g, (_, match) => {\n\t\tif (match === '**') return ++idx % 2 ? `\\\\*${match}` : `${match}\\\\*`;\n\t\treturn `\\\\*${match}`;\n\t});\n\tidx = 0;\n\treturn newText.replaceAll(/(?<=^|[^_])(?<!<a?:.+|https?:\\/\\/\\S+)_(?!:\\d+>)([^_]|__|$)/g, (_, match) => {\n\t\tif (match === '__') return ++idx % 2 ? `\\\\_${match}` : `${match}\\\\_`;\n\t\treturn `\\\\_${match}`;\n\t});\n}\n\n/**\n * Escapes bold markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBold(text: string): string {\n\tlet idx = 0;\n\treturn text.replaceAll(/\\*\\*(\\*)?/g, (_, match) => {\n\t\tif (match) return ++idx % 2 ? `${match}\\\\*\\\\*` : `\\\\*\\\\*${match}`;\n\t\treturn '\\\\*\\\\*';\n\t});\n}\n\n/**\n * Escapes underline markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeUnderline(text: string): string {\n\tlet idx = 0;\n\treturn text.replaceAll(/(?<!<a?:.+|https?:\\/\\/\\S+)__(_)?(?!:\\d+>)/g, (_, match) => {\n\t\tif (match) return ++idx % 2 ? `${match}\\\\_\\\\_` : `\\\\_\\\\_${match}`;\n\t\treturn '\\\\_\\\\_';\n\t});\n}\n\n/**\n * Escapes strikethrough markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeStrikethrough(text: string): string {\n\treturn text.replaceAll('~~', '\\\\~\\\\~');\n}\n\n/**\n * Escapes spoiler markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeSpoiler(text: string): string {\n\treturn text.replaceAll('||', '\\\\|\\\\|');\n}\n\n/**\n * Escapes escape characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeEscape(text: string): string {\n\treturn text.replaceAll('\\\\', '\\\\\\\\');\n}\n\n/**\n * Escapes heading characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeHeading(text: string): string {\n\treturn text.replaceAll(/^( {0,2})([*-] )?( *)(#{1,3} )/gm, '$1$2$3\\\\$4');\n}\n\n/**\n * Escapes bulleted list characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBulletedList(text: string): string {\n\treturn text.replaceAll(/^( *)([*-])( +)/gm, '$1\\\\$2$3');\n}\n\n/**\n * Escapes numbered list characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeNumberedList(text: string): string {\n\treturn text.replaceAll(/^( *\\d+)\\./gm, '$1\\\\.');\n}\n\n/**\n * Escapes masked link characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeMaskedLink(text: string): string {\n\treturn text.replaceAll(/\\[.+]\\(.+\\)/gm, '\\\\$&');\n}\n","import type { URL } from 'node:url';\nimport type { Snowflake } from 'discord-api-types/globals';\n\n/**\n * Wraps the content inside a code block with no language.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function codeBlock<Content extends string>(content: Content): `\\`\\`\\`\\n${Content}\\n\\`\\`\\``;\n\n/**\n * Wraps the content inside a code block with the specified language.\n *\n * @typeParam Language - This is inferred by the supplied language\n * @typeParam Content - This is inferred by the supplied content\n * @param language - The language for the code block\n * @param content - The content to wrap\n */\nexport function codeBlock<Language extends string, Content extends string>(\n\tlanguage: Language,\n\tcontent: Content,\n): `\\`\\`\\`${Language}\\n${Content}\\n\\`\\`\\``;\n\nexport function codeBlock(language: string, content?: string): string {\n\treturn content === undefined ? `\\`\\`\\`\\n${language}\\n\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\n\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\` which formats it as inline code.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function inlineCode<Content extends string>(content: Content): `\\`${Content}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function italic<Content extends string>(content: Content): `_${Content}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function bold<Content extends string>(content: Content): `**${Content}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underlined text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function underline<Content extends string>(content: Content): `__${Content}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function strikethrough<Content extends string>(content: Content): `~~${Content}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote.\n *\n * @remarks This needs to be at the start of the line for Discord to format it.\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function quote<Content extends string>(content: Content): `> ${Content}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote.\n *\n * @remarks This needs to be at the start of the line for Discord to format it.\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function blockQuote<Content extends string>(content: Content): `>>> ${Content}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>` which stops it from embedding.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param url - The URL to wrap\n */\nexport function hideLinkEmbed<Content extends string>(url: Content): `<${Content}>`;\n\n/**\n * Wraps the URL into `<>` which stops it from embedding.\n *\n * @param url - The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\n\nexport function hideLinkEmbed(url: URL | string) {\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to display\n * @param url - The URL the content links to\n */\nexport function hyperlink<Content extends string>(content: Content, url: URL): `[${Content}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Url - This is inferred by the supplied URL\n * @param content - The content to display\n * @param url - The URL the content links to\n */\nexport function hyperlink<Content extends string, Url extends string>(\n\tcontent: Content,\n\turl: Url,\n): `[${Content}](${Url})`;\n\n/**\n * Formats the content and the URL into a masked URL with a custom tooltip.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Title - This is inferred by the supplied title\n * @param content - The content to display\n * @param url - The URL the content links to\n * @param title - The title shown when hovering on the masked link\n */\nexport function hyperlink<Content extends string, Title extends string>(\n\tcontent: Content,\n\turl: URL,\n\ttitle: Title,\n): `[${Content}](${string} \"${Title}\")`;\n\n/**\n * Formats the content and the URL into a masked URL with a custom tooltip.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Url - This is inferred by the supplied URL\n * @typeParam Title - This is inferred by the supplied title\n * @param content - The content to display\n * @param url - The URL the content links to\n * @param title - The title shown when hovering on the masked link\n */\nexport function hyperlink<Content extends string, Url extends string, Title extends string>(\n\tcontent: Content,\n\turl: Url,\n\ttitle: Title,\n): `[${Content}](${Url} \"${Title}\")`;\n\nexport function hyperlink(content: string, url: URL | string, title?: string) {\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Formats the content into a spoiler.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function spoiler<Content extends string>(content: Content): `||${Content}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user id into a user mention.\n *\n * @typeParam UserId - This is inferred by the supplied user id\n * @param userId - The user id to format\n */\nexport function userMention<UserId extends Snowflake>(userId: UserId): `<@${UserId}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a channel id into a channel mention.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @param channelId - The channel id to format\n */\nexport function channelMention<ChannelId extends Snowflake>(channelId: ChannelId): `<#${ChannelId}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role id into a role mention.\n *\n * @typeParam RoleId - This is inferred by the supplied role id\n * @param roleId - The role id to format\n */\nexport function roleMention<RoleId extends Snowflake>(roleId: RoleId): `<@&${RoleId}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats a role id into a linked role mention.\n *\n * @typeParam RoleId - This is inferred by the supplied role id\n * @param roleId - The role id to format\n */\nexport function linkedRoleMention<RoleId extends Snowflake>(roleId: RoleId): `<id:linked-roles:${RoleId}>` {\n\treturn `<id:linked-roles:${roleId}>`;\n}\n\n/**\n * Formats an application command name and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n */\nexport function chatInputApplicationCommandMention<CommandId extends Snowflake, CommandName extends string>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n): `</${CommandName}:${CommandId}>`;\n\n/**\n * Formats an application command name, subcommand name, and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @typeParam SubcommandName - This is inferred by the supplied subcommand name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n * @param subcommandName - The subcommand name to format\n */\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName: SubcommandName,\n): `</${CommandName} ${SubcommandName}:${CommandId}>`;\n\n/**\n * Formats an application command name, subcommand group name, subcommand name, and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @typeParam SubcommandName - This is inferred by the supplied subcommand name\n * @typeParam SubcommandGroupName - This is inferred by the supplied subcommand group name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n * @param subcommandName - The subcommand name to format\n * @param subcommandGroupName - The subcommand group name to format\n */\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n\tSubcommandGroupName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName: SubcommandName,\n\tsubcommandGroupName: SubcommandGroupName,\n): `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`;\n\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n\tSubcommandGroupName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName?: SubcommandName | undefined,\n\tsubcommandGroupName?: SubcommandGroupName | undefined,\n):\n\t| `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`\n\t| `</${CommandName} ${SubcommandName}:${CommandId}>`\n\t| `</${CommandName}:${CommandId}>` {\n\tif (subcommandGroupName !== undefined && subcommandName !== undefined) {\n\t\treturn `</${commandName} ${subcommandGroupName} ${subcommandName}:${commandId}>`;\n\t}\n\n\tif (subcommandName !== undefined) {\n\t\treturn `</${commandName} ${subcommandName}:${commandId}>`;\n\t}\n\n\treturn `</${commandName}:${commandId}>`;\n}\n\n/**\n * Formats a non-animated emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n */\nexport function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:emoji:${EmojiId}>`;\n\n/**\n * Formats an animated emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n * @param animated - Whether the emoji is animated\n */\nexport function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:emoji:${EmojiId}>`;\n\n/**\n * Formats an emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n * @param animated - Whether the emoji is animated\n */\nexport function formatEmoji<EmojiId extends Snowflake>(\n\temojiId: EmojiId,\n\tanimated?: boolean,\n): `<:emoji:${EmojiId}>` | `<a:emoji:${EmojiId}>`;\n\n/**\n * Formats a non-animated emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName> & { animated: true },\n): `<a:${EmojiName}:${EmojiId}>`;\n\n/**\n * Formats an animated emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName> & { animated?: false },\n): `<:${EmojiName}:${EmojiId}>`;\n\n/**\n * Formats an emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied emoji name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName>,\n): `<:${EmojiName}:${EmojiId}>` | `<a:${EmojiName}:${EmojiId}>`;\n\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\temojiIdOrOptions: EmojiId | FormatEmojiOptions<EmojiId, EmojiName>,\n\tanimated?: boolean,\n): `<:${string}:${EmojiId}>` | `<a:${string}:${EmojiId}>` {\n\tconst options =\n\t\ttypeof emojiIdOrOptions === 'string'\n\t\t\t? {\n\t\t\t\t\tid: emojiIdOrOptions,\n\t\t\t\t\tanimated: animated ?? false,\n\t\t\t\t}\n\t\t\t: emojiIdOrOptions;\n\n\tconst { id, animated: isAnimated, name: emojiName } = options;\n\n\treturn `<${isAnimated ? 'a' : ''}:${emojiName ?? 'emoji'}:${id}>`;\n}\n\n/**\n * The options for formatting an emoji.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied emoji name\n */\nexport interface FormatEmojiOptions<EmojiId extends Snowflake, EmojiName extends string> {\n\t/**\n\t * Whether the emoji is animated\n\t */\n\tanimated?: boolean;\n\t/**\n\t * The emoji id to format\n\t */\n\tid: EmojiId;\n\t/**\n\t * The name of the emoji\n\t */\n\tname?: EmojiName;\n}\n\n/**\n * Formats a channel link for a direct message channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @param channelId - The channel's id\n */\nexport function channelLink<ChannelId extends Snowflake>(\n\tchannelId: ChannelId,\n): `https://discord.com/channels/@me/${ChannelId}`;\n\n/**\n * Formats a channel link for a guild channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam GuildId - This is inferred by the supplied guild id\n * @param channelId - The channel's id\n * @param guildId - The guild's id\n */\nexport function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tguildId: GuildId,\n): `https://discord.com/channels/${GuildId}/${ChannelId}`;\n\nexport function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tguildId?: GuildId,\n): `https://discord.com/channels/@me/${ChannelId}` | `https://discord.com/channels/${GuildId}/${ChannelId}` {\n\treturn `https://discord.com/channels/${guildId ?? '@me'}/${channelId}`;\n}\n\n/**\n * Formats a message link for a direct message channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam MessageId - This is inferred by the supplied message id\n * @param channelId - The channel's id\n * @param messageId - The message's id\n */\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n): `https://discord.com/channels/@me/${ChannelId}/${MessageId}`;\n\n/**\n * Formats a message link for a guild channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam MessageId - This is inferred by the supplied message id\n * @typeParam GuildId - This is inferred by the supplied guild id\n * @param channelId - The channel's id\n * @param messageId - The message's id\n * @param guildId - The guild's id\n */\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n\tguildId: GuildId,\n): `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}`;\n\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n\tguildId?: GuildId,\n):\n\t| `https://discord.com/channels/@me/${ChannelId}/${MessageId}`\n\t| `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}` {\n\treturn `${guildId === undefined ? channelLink(channelId) : channelLink(channelId, guildId)}/${messageId}`;\n}\n\n/**\n * The heading levels for expanded markdown.\n */\nexport enum HeadingLevel {\n\t/**\n\t * The first heading level.\n\t */\n\tOne = 1,\n\t/**\n\t * The second heading level.\n\t */\n\tTwo,\n\t/**\n\t * The third heading level.\n\t */\n\tThree,\n}\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level?: HeadingLevel.One): `# ${Content}`;\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level: HeadingLevel.Two): `## ${Content}`;\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level: HeadingLevel.Three): `### ${Content}`;\n\nexport function heading(content: string, level?: HeadingLevel) {\n\t// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n\tswitch (level) {\n\t\tcase HeadingLevel.Three:\n\t\t\treturn `### ${content}`;\n\t\tcase HeadingLevel.Two:\n\t\t\treturn `## ${content}`;\n\t\tdefault:\n\t\t\treturn `# ${content}`;\n\t}\n}\n\n/**\n * A type that recursively traverses into arrays.\n */\nexport type RecursiveArray<ItemType> = readonly (ItemType | RecursiveArray<ItemType>)[];\n\n/**\n * Callback function for list formatters.\n *\n * @internal\n */\nfunction listCallback(element: RecursiveArray<string>, startNumber?: number, depth = 0): string {\n\tif (Array.isArray(element)) {\n\t\treturn element.map((element) => listCallback(element, startNumber, depth + 1)).join('\\n');\n\t}\n\n\treturn `${' '.repeat(depth - 1)}${startNumber ? `${startNumber}.` : '-'} ${element}`;\n}\n\n/**\n * Formats the elements in the array to an ordered list.\n *\n * @param list - The array of elements to list\n * @param startNumber - The starting number for the list\n */\nexport function orderedList(list: RecursiveArray<string>, startNumber = 1): string {\n\treturn listCallback(list, Math.max(startNumber, 1));\n}\n\n/**\n * Formats the elements in the array to an unordered list.\n *\n * @param list - The array of elements to list\n */\nexport function unorderedList(list: RecursiveArray<string>): string {\n\treturn listCallback(list);\n}\n\n/**\n * Formats the content into a subtext.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function subtext<Content extends string>(content: Content): `-# ${Content}` {\n\treturn `-# ${content}`;\n}\n\n/**\n * Formats a date into a short date-time string.\n *\n * @param date - The date to format. Defaults to the current time\n */\nexport function time(date?: Date): `<t:${bigint}>`;\n\n/**\n * Formats a date given a format style.\n *\n * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}\n * @param date - The date to format\n * @param style - The style to use\n */\nexport function time<Style extends TimestampStylesString>(date: Date, style: Style): `<t:${bigint}:${Style}>`;\n\n/**\n * Formats the given timestamp into a short date-time string.\n *\n * @typeParam Seconds - This is inferred by the supplied timestamp\n * @param seconds - A Unix timestamp in seconds\n */\nexport function time<Seconds extends number>(seconds: Seconds): `<t:${Seconds}>`;\n\n/**\n * Formats the given timestamp into a short date-time string.\n *\n * @typeParam Seconds - This is inferred by the supplied timestamp\n * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}\n * @param seconds - A Unix timestamp in seconds\n * @param style - The style to use\n */\nexport function time<Seconds extends number, Style extends TimestampStylesString>(\n\tseconds: Seconds,\n\tstyle: Style,\n): `<t:${Seconds}:${Style}>`;\n\nexport function time(timeOrSeconds?: Date | number, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1_000);\n\t}\n\n\treturn typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;\n}\n\n/**\n * Formats an application directory link.\n *\n * @typeParam ApplicationId - This is inferred by the supplied application id\n * @param applicationId - The application id\n */\nexport function applicationDirectory<ApplicationId extends Snowflake>(\n\tapplicationId: ApplicationId,\n): `https://discord.com/application-directory/${ApplicationId}/store`;\n\n/**\n * Formats an application directory SKU link.\n *\n * @typeParam ApplicationId - This is inferred by the supplied application id\n * @typeParam SKUId - This is inferred by the supplied SKU id\n * @param applicationId - The application id\n * @param skuId - The SKU id\n */\nexport function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(\n\tapplicationId: ApplicationId,\n\tskuId: SKUId,\n): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;\n\nexport function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(\n\tapplicationId: ApplicationId,\n\tskuId?: SKUId,\n):\n\t| `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`\n\t| `https://discord.com/application-directory/${ApplicationId}/store` {\n\tconst url = `https://discord.com/application-directory/${applicationId}/store` as const;\n\treturn skuId ? `${url}/${skuId}` : url;\n}\n\n/**\n * Formats an email address into an email mention.\n *\n * @typeParam Email - This is inferred by the supplied email address\n * @param email - The email address to format\n */\nexport function email<Email extends string>(email: Email): `<${Email}>`;\n\n/**\n * Formats an email address and headers into an email mention.\n *\n * @typeParam Email - This is inferred by the supplied email address\n * @param email - The email address to format\n * @param headers - Optional headers to include in the email mention\n */\nexport function email<Email extends string>(\n\temail: Email,\n\theaders: Record<string, string | readonly string[]> | undefined,\n): `<${Email}?${string}>`;\n\n/**\n * Formats an email address into an email mention.\n *\n * @typeParam Email - This is inferred by the supplied email address\n * @param email - The email address to format\n * @param headers - Optional headers to include in the email mention\n */\nexport function email<Email extends string>(email: Email, headers?: Record<string, string | readonly string[]>) {\n\tif (headers) {\n\t\t// eslint-disable-next-line n/prefer-global/url-search-params\n\t\tconst searchParams = new URLSearchParams(\n\t\t\tObject.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value])),\n\t\t);\n\n\t\treturn `<${email}?${searchParams.toString()}>` as const;\n\t}\n\n\treturn `<${email}>` as const;\n}\n\n/**\n * Formats a phone number into a phone number mention.\n *\n * @typeParam PhoneNumber - This is inferred by the supplied phone number\n * @param phoneNumber - The phone number to format. Must start with a `+` sign.\n */\nexport function phoneNumber<PhoneNumber extends `+${string}`>(phoneNumber: PhoneNumber) {\n\tif (!phoneNumber.startsWith('+')) {\n\t\tthrow new Error('Phone number must start with a \"+\" sign.');\n\t}\n\n\treturn `<${phoneNumber}>` as const;\n}\n\n/**\n * The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}\n * supported by Discord.\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes.\n\t *\n\t * @example `16:20`\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds.\n\t *\n\t * @example `16:20:30`\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year.\n\t *\n\t * @example `20/04/2021`\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year.\n\t *\n\t * @example `20 April 2021`\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats.\n\t *\n\t * @example `20 April 2021 16:20`\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats.\n\t *\n\t * @example `Tuesday, 20 April 2021 16:20`\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format.\n\t *\n\t * @example `2 months ago`\n\t */\n\tRelativeTime: 'R',\n} as const satisfies Record<string, string>;\n\n/**\n * The possible {@link TimestampStyles} values.\n */\nexport type TimestampStylesString = (typeof TimestampStyles)[keyof typeof TimestampStyles];\n\n/**\n * All the available faces from Discord's native slash commands.\n */\nexport enum Faces {\n\t/**\n\t * `¯\\_(ツ)_/¯`\n\t */\n\tShrug = '¯\\\\_(ツ)_/¯',\n\n\t/**\n\t * `(╯°□°)╯︵ ┻━┻`\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * `┬─┬ノ( º _ ºノ)`\n\t */\n\tUnflip = '┬─┬ノ( º _ ºノ)',\n}\n\n/**\n * All the available guild navigation mentions.\n */\nexport enum GuildNavigationMentions {\n\t/**\n\t * Browse Channels tab.\n\t */\n\tBrowse = '<id:browse>',\n\t/**\n\t * Customize tab with the server's {@link https://discord.com/developers/docs/resources/guild#guild-onboarding-object | onboarding prompts}.\n\t */\n\tCustomize = '<id:customize>',\n\t/**\n\t * {@link https://support.discord.com/hc/articles/13497665141655 | Server Guide} tab.\n\t */\n\tGuide = '<id:guide>',\n\t/**\n\t * {@link https://support.discord.com/hc/articles/10388356626711 | Linked Roles} tab.\n\t */\n\tLinkedRoles = '<id:linked-roles>',\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC8GO,SAAS,eAAe,MAAc,UAAiC,CAAC,GAAW;AACzF,QAAM;AAAA,IACL,WAAAA,aAAY;AAAA,IACZ,YAAAC,cAAa;AAAA,IACb,MAAAC,QAAO;AAAA,IACP,QAAAC,UAAS;AAAA,IACT,WAAAC,aAAY;AAAA,IACZ,eAAAC,iBAAgB;AAAA,IAChB,SAAAC,WAAU;AAAA,IACV,mBAAmB;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el","element","email","phoneNumber","Faces","GuildNavigationMentions"]}
|
package/dist/index.mjs
CHANGED
|
@@ -278,6 +278,23 @@ function applicationDirectory(applicationId, skuId) {
|
|
|
278
278
|
return skuId ? `${url}/${skuId}` : url;
|
|
279
279
|
}
|
|
280
280
|
__name(applicationDirectory, "applicationDirectory");
|
|
281
|
+
function email(email2, headers) {
|
|
282
|
+
if (headers) {
|
|
283
|
+
const searchParams = new URLSearchParams(
|
|
284
|
+
Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value]))
|
|
285
|
+
);
|
|
286
|
+
return `<${email2}?${searchParams.toString()}>`;
|
|
287
|
+
}
|
|
288
|
+
return `<${email2}>`;
|
|
289
|
+
}
|
|
290
|
+
__name(email, "email");
|
|
291
|
+
function phoneNumber(phoneNumber2) {
|
|
292
|
+
if (!phoneNumber2.startsWith("+")) {
|
|
293
|
+
throw new Error('Phone number must start with a "+" sign.');
|
|
294
|
+
}
|
|
295
|
+
return `<${phoneNumber2}>`;
|
|
296
|
+
}
|
|
297
|
+
__name(phoneNumber, "phoneNumber");
|
|
281
298
|
var TimestampStyles = {
|
|
282
299
|
/**
|
|
283
300
|
* Short time format, consisting of hours and minutes.
|
|
@@ -337,7 +354,7 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
|
|
|
337
354
|
})(GuildNavigationMentions || {});
|
|
338
355
|
|
|
339
356
|
// src/index.ts
|
|
340
|
-
var version = "1.0.0-dev.
|
|
357
|
+
var version = "1.0.0-dev.1756252914-50018979e";
|
|
341
358
|
export {
|
|
342
359
|
Faces,
|
|
343
360
|
GuildNavigationMentions,
|
|
@@ -350,6 +367,7 @@ export {
|
|
|
350
367
|
channelMention,
|
|
351
368
|
chatInputApplicationCommandMention,
|
|
352
369
|
codeBlock,
|
|
370
|
+
email,
|
|
353
371
|
escapeBold,
|
|
354
372
|
escapeBulletedList,
|
|
355
373
|
escapeCodeBlock,
|
|
@@ -372,6 +390,7 @@ export {
|
|
|
372
390
|
linkedRoleMention,
|
|
373
391
|
messageLink,
|
|
374
392
|
orderedList,
|
|
393
|
+
phoneNumber,
|
|
375
394
|
quote,
|
|
376
395
|
roleMention,
|
|
377
396
|
spoiler,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/escapers.ts","../src/formatters.ts","../src/index.ts"],"sourcesContent":["/* eslint-disable prefer-named-capture-group */\n\n/**\n * The options that affect what will be escaped.\n */\nexport interface EscapeMarkdownOptions {\n\t/**\n\t * Whether to escape bold text.\n\t *\n\t * @defaultValue `true`\n\t */\n\tbold?: boolean;\n\n\t/**\n\t * Whether to escape bulleted lists.\n\t *\n\t * @defaultValue `true`\n\t */\n\tbulletedList?: boolean;\n\n\t/**\n\t * Whether to escape code blocks.\n\t *\n\t * @defaultValue `true`\n\t */\n\tcodeBlock?: boolean;\n\n\t/**\n\t * Whether to escape text inside code blocks.\n\t *\n\t * @defaultValue `true`\n\t */\n\tcodeBlockContent?: boolean;\n\n\t/**\n\t * Whether to escape `\\`.\n\t *\n\t * @defaultValue `true`\n\t */\n\tescape?: boolean;\n\n\t/**\n\t * Whether to escape headings.\n\t *\n\t * @defaultValue `true`\n\t */\n\theading?: boolean;\n\n\t/**\n\t * Whether to escape inline code.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinlineCode?: boolean;\n\n\t/**\n\t * Whether to escape text inside inline code.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinlineCodeContent?: boolean;\n\t/**\n\t * Whether to escape italics.\n\t *\n\t * @defaultValue `true`\n\t */\n\titalic?: boolean;\n\n\t/**\n\t * Whether to escape masked links.\n\t *\n\t * @defaultValue `true`\n\t */\n\tmaskedLink?: boolean;\n\n\t/**\n\t * Whether to escape numbered lists.\n\t *\n\t * @defaultValue `true`\n\t */\n\tnumberedList?: boolean;\n\n\t/**\n\t * Whether to escape spoilers.\n\t *\n\t * @defaultValue `true`\n\t */\n\tspoiler?: boolean;\n\n\t/**\n\t * Whether to escape strikethroughs.\n\t *\n\t * @defaultValue `true`\n\t */\n\tstrikethrough?: boolean;\n\n\t/**\n\t * Whether to escape underlines.\n\t *\n\t * @defaultValue `true`\n\t */\n\tunderline?: boolean;\n}\n\n/**\n * Escapes any Discord-flavored markdown in a string.\n *\n * @param text - Content to escape\n * @param options - Options for escaping the markdown\n */\nexport function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}): string {\n\tconst {\n\t\tcodeBlock = true,\n\t\tinlineCode = true,\n\t\tbold = true,\n\t\titalic = true,\n\t\tunderline = true,\n\t\tstrikethrough = true,\n\t\tspoiler = true,\n\t\tcodeBlockContent = true,\n\t\tinlineCodeContent = true,\n\t\tescape = true,\n\t\theading = true,\n\t\tbulletedList = true,\n\t\tnumberedList = true,\n\t\tmaskedLink = true,\n\t} = options;\n\n\tif (!codeBlockContent) {\n\t\treturn text\n\t\t\t.split('```')\n\t\t\t.map((subString, index, array) => {\n\t\t\t\tif (index % 2 && index !== array.length - 1) return subString;\n\t\t\t\treturn escapeMarkdown(subString, {\n\t\t\t\t\tinlineCode,\n\t\t\t\t\tbold,\n\t\t\t\t\titalic,\n\t\t\t\t\tunderline,\n\t\t\t\t\tstrikethrough,\n\t\t\t\t\tspoiler,\n\t\t\t\t\tinlineCodeContent,\n\t\t\t\t\tescape,\n\t\t\t\t\theading,\n\t\t\t\t\tbulletedList,\n\t\t\t\t\tnumberedList,\n\t\t\t\t\tmaskedLink,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.join(codeBlock ? '\\\\`\\\\`\\\\`' : '```');\n\t}\n\n\tif (!inlineCodeContent) {\n\t\treturn text\n\t\t\t.split(/(?<=^|[^`])`(?=[^`]|$)/g)\n\t\t\t.map((subString, index, array) => {\n\t\t\t\tif (index % 2 && index !== array.length - 1) return subString;\n\t\t\t\treturn escapeMarkdown(subString, {\n\t\t\t\t\tcodeBlock,\n\t\t\t\t\tbold,\n\t\t\t\t\titalic,\n\t\t\t\t\tunderline,\n\t\t\t\t\tstrikethrough,\n\t\t\t\t\tspoiler,\n\t\t\t\t\tescape,\n\t\t\t\t\theading,\n\t\t\t\t\tbulletedList,\n\t\t\t\t\tnumberedList,\n\t\t\t\t\tmaskedLink,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.join(inlineCode ? '\\\\`' : '`');\n\t}\n\n\tlet res = text;\n\tif (escape) res = escapeEscape(res);\n\tif (inlineCode) res = escapeInlineCode(res);\n\tif (codeBlock) res = escapeCodeBlock(res);\n\tif (italic) res = escapeItalic(res);\n\tif (bold) res = escapeBold(res);\n\tif (underline) res = escapeUnderline(res);\n\tif (strikethrough) res = escapeStrikethrough(res);\n\tif (spoiler) res = escapeSpoiler(res);\n\tif (heading) res = escapeHeading(res);\n\tif (bulletedList) res = escapeBulletedList(res);\n\tif (numberedList) res = escapeNumberedList(res);\n\tif (maskedLink) res = escapeMaskedLink(res);\n\treturn res;\n}\n\n/**\n * Escapes code block markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeCodeBlock(text: string): string {\n\treturn text.replaceAll('```', '\\\\`\\\\`\\\\`');\n}\n\n/**\n * Escapes inline code markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeInlineCode(text: string): string {\n\treturn text.replaceAll(/(?<=^|[^`])``?(?=[^`]|$)/g, (match) => (match.length === 2 ? '\\\\`\\\\`' : '\\\\`'));\n}\n\n/**\n * Escapes italic markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeItalic(text: string): string {\n\tlet idx = 0;\n\tconst newText = text.replaceAll(/(?<=^|[^*])\\*([^*]|\\*\\*|$)/g, (_, match) => {\n\t\tif (match === '**') return ++idx % 2 ? `\\\\*${match}` : `${match}\\\\*`;\n\t\treturn `\\\\*${match}`;\n\t});\n\tidx = 0;\n\treturn newText.replaceAll(/(?<=^|[^_])(?<!<a?:.+|https?:\\/\\/\\S+)_(?!:\\d+>)([^_]|__|$)/g, (_, match) => {\n\t\tif (match === '__') return ++idx % 2 ? `\\\\_${match}` : `${match}\\\\_`;\n\t\treturn `\\\\_${match}`;\n\t});\n}\n\n/**\n * Escapes bold markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBold(text: string): string {\n\tlet idx = 0;\n\treturn text.replaceAll(/\\*\\*(\\*)?/g, (_, match) => {\n\t\tif (match) return ++idx % 2 ? `${match}\\\\*\\\\*` : `\\\\*\\\\*${match}`;\n\t\treturn '\\\\*\\\\*';\n\t});\n}\n\n/**\n * Escapes underline markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeUnderline(text: string): string {\n\tlet idx = 0;\n\treturn text.replaceAll(/(?<!<a?:.+|https?:\\/\\/\\S+)__(_)?(?!:\\d+>)/g, (_, match) => {\n\t\tif (match) return ++idx % 2 ? `${match}\\\\_\\\\_` : `\\\\_\\\\_${match}`;\n\t\treturn '\\\\_\\\\_';\n\t});\n}\n\n/**\n * Escapes strikethrough markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeStrikethrough(text: string): string {\n\treturn text.replaceAll('~~', '\\\\~\\\\~');\n}\n\n/**\n * Escapes spoiler markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeSpoiler(text: string): string {\n\treturn text.replaceAll('||', '\\\\|\\\\|');\n}\n\n/**\n * Escapes escape characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeEscape(text: string): string {\n\treturn text.replaceAll('\\\\', '\\\\\\\\');\n}\n\n/**\n * Escapes heading characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeHeading(text: string): string {\n\treturn text.replaceAll(/^( {0,2})([*-] )?( *)(#{1,3} )/gm, '$1$2$3\\\\$4');\n}\n\n/**\n * Escapes bulleted list characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBulletedList(text: string): string {\n\treturn text.replaceAll(/^( *)([*-])( +)/gm, '$1\\\\$2$3');\n}\n\n/**\n * Escapes numbered list characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeNumberedList(text: string): string {\n\treturn text.replaceAll(/^( *\\d+)\\./gm, '$1\\\\.');\n}\n\n/**\n * Escapes masked link characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeMaskedLink(text: string): string {\n\treturn text.replaceAll(/\\[.+]\\(.+\\)/gm, '\\\\$&');\n}\n","import type { URL } from 'node:url';\nimport type { Snowflake } from 'discord-api-types/globals';\n\n/**\n * Wraps the content inside a code block with no language.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function codeBlock<Content extends string>(content: Content): `\\`\\`\\`\\n${Content}\\n\\`\\`\\``;\n\n/**\n * Wraps the content inside a code block with the specified language.\n *\n * @typeParam Language - This is inferred by the supplied language\n * @typeParam Content - This is inferred by the supplied content\n * @param language - The language for the code block\n * @param content - The content to wrap\n */\nexport function codeBlock<Language extends string, Content extends string>(\n\tlanguage: Language,\n\tcontent: Content,\n): `\\`\\`\\`${Language}\\n${Content}\\n\\`\\`\\``;\n\nexport function codeBlock(language: string, content?: string): string {\n\treturn content === undefined ? `\\`\\`\\`\\n${language}\\n\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\n\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\` which formats it as inline code.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function inlineCode<Content extends string>(content: Content): `\\`${Content}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function italic<Content extends string>(content: Content): `_${Content}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function bold<Content extends string>(content: Content): `**${Content}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underlined text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function underline<Content extends string>(content: Content): `__${Content}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function strikethrough<Content extends string>(content: Content): `~~${Content}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote.\n *\n * @remarks This needs to be at the start of the line for Discord to format it.\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function quote<Content extends string>(content: Content): `> ${Content}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote.\n *\n * @remarks This needs to be at the start of the line for Discord to format it.\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function blockQuote<Content extends string>(content: Content): `>>> ${Content}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>` which stops it from embedding.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param url - The URL to wrap\n */\nexport function hideLinkEmbed<Content extends string>(url: Content): `<${Content}>`;\n\n/**\n * Wraps the URL into `<>` which stops it from embedding.\n *\n * @param url - The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\n\nexport function hideLinkEmbed(url: URL | string) {\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to display\n * @param url - The URL the content links to\n */\nexport function hyperlink<Content extends string>(content: Content, url: URL): `[${Content}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Url - This is inferred by the supplied URL\n * @param content - The content to display\n * @param url - The URL the content links to\n */\nexport function hyperlink<Content extends string, Url extends string>(\n\tcontent: Content,\n\turl: Url,\n): `[${Content}](${Url})`;\n\n/**\n * Formats the content and the URL into a masked URL with a custom tooltip.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Title - This is inferred by the supplied title\n * @param content - The content to display\n * @param url - The URL the content links to\n * @param title - The title shown when hovering on the masked link\n */\nexport function hyperlink<Content extends string, Title extends string>(\n\tcontent: Content,\n\turl: URL,\n\ttitle: Title,\n): `[${Content}](${string} \"${Title}\")`;\n\n/**\n * Formats the content and the URL into a masked URL with a custom tooltip.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Url - This is inferred by the supplied URL\n * @typeParam Title - This is inferred by the supplied title\n * @param content - The content to display\n * @param url - The URL the content links to\n * @param title - The title shown when hovering on the masked link\n */\nexport function hyperlink<Content extends string, Url extends string, Title extends string>(\n\tcontent: Content,\n\turl: Url,\n\ttitle: Title,\n): `[${Content}](${Url} \"${Title}\")`;\n\nexport function hyperlink(content: string, url: URL | string, title?: string) {\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Formats the content into a spoiler.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function spoiler<Content extends string>(content: Content): `||${Content}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user id into a user mention.\n *\n * @typeParam UserId - This is inferred by the supplied user id\n * @param userId - The user id to format\n */\nexport function userMention<UserId extends Snowflake>(userId: UserId): `<@${UserId}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a channel id into a channel mention.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @param channelId - The channel id to format\n */\nexport function channelMention<ChannelId extends Snowflake>(channelId: ChannelId): `<#${ChannelId}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role id into a role mention.\n *\n * @typeParam RoleId - This is inferred by the supplied role id\n * @param roleId - The role id to format\n */\nexport function roleMention<RoleId extends Snowflake>(roleId: RoleId): `<@&${RoleId}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats a role id into a linked role mention.\n *\n * @typeParam RoleId - This is inferred by the supplied role id\n * @param roleId - The role id to format\n */\nexport function linkedRoleMention<RoleId extends Snowflake>(roleId: RoleId): `<id:linked-roles:${RoleId}>` {\n\treturn `<id:linked-roles:${roleId}>`;\n}\n\n/**\n * Formats an application command name and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n */\nexport function chatInputApplicationCommandMention<CommandId extends Snowflake, CommandName extends string>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n): `</${CommandName}:${CommandId}>`;\n\n/**\n * Formats an application command name, subcommand name, and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @typeParam SubcommandName - This is inferred by the supplied subcommand name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n * @param subcommandName - The subcommand name to format\n */\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName: SubcommandName,\n): `</${CommandName} ${SubcommandName}:${CommandId}>`;\n\n/**\n * Formats an application command name, subcommand group name, subcommand name, and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @typeParam SubcommandName - This is inferred by the supplied subcommand name\n * @typeParam SubcommandGroupName - This is inferred by the supplied subcommand group name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n * @param subcommandName - The subcommand name to format\n * @param subcommandGroupName - The subcommand group name to format\n */\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n\tSubcommandGroupName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName: SubcommandName,\n\tsubcommandGroupName: SubcommandGroupName,\n): `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`;\n\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n\tSubcommandGroupName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName?: SubcommandName | undefined,\n\tsubcommandGroupName?: SubcommandGroupName | undefined,\n):\n\t| `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`\n\t| `</${CommandName} ${SubcommandName}:${CommandId}>`\n\t| `</${CommandName}:${CommandId}>` {\n\tif (subcommandGroupName !== undefined && subcommandName !== undefined) {\n\t\treturn `</${commandName} ${subcommandGroupName} ${subcommandName}:${commandId}>`;\n\t}\n\n\tif (subcommandName !== undefined) {\n\t\treturn `</${commandName} ${subcommandName}:${commandId}>`;\n\t}\n\n\treturn `</${commandName}:${commandId}>`;\n}\n\n/**\n * Formats a non-animated emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n */\nexport function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:emoji:${EmojiId}>`;\n\n/**\n * Formats an animated emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n * @param animated - Whether the emoji is animated\n */\nexport function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:emoji:${EmojiId}>`;\n\n/**\n * Formats an emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n * @param animated - Whether the emoji is animated\n */\nexport function formatEmoji<EmojiId extends Snowflake>(\n\temojiId: EmojiId,\n\tanimated?: boolean,\n): `<:emoji:${EmojiId}>` | `<a:emoji:${EmojiId}>`;\n\n/**\n * Formats a non-animated emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName> & { animated: true },\n): `<a:${EmojiName}:${EmojiId}>`;\n\n/**\n * Formats an animated emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName> & { animated?: false },\n): `<:${EmojiName}:${EmojiId}>`;\n\n/**\n * Formats an emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied emoji name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName>,\n): `<:${EmojiName}:${EmojiId}>` | `<a:${EmojiName}:${EmojiId}>`;\n\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\temojiIdOrOptions: EmojiId | FormatEmojiOptions<EmojiId, EmojiName>,\n\tanimated?: boolean,\n): `<:${string}:${EmojiId}>` | `<a:${string}:${EmojiId}>` {\n\tconst options =\n\t\ttypeof emojiIdOrOptions === 'string'\n\t\t\t? {\n\t\t\t\t\tid: emojiIdOrOptions,\n\t\t\t\t\tanimated: animated ?? false,\n\t\t\t\t}\n\t\t\t: emojiIdOrOptions;\n\n\tconst { id, animated: isAnimated, name: emojiName } = options;\n\n\treturn `<${isAnimated ? 'a' : ''}:${emojiName ?? 'emoji'}:${id}>`;\n}\n\n/**\n * The options for formatting an emoji.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied emoji name\n */\nexport interface FormatEmojiOptions<EmojiId extends Snowflake, EmojiName extends string> {\n\t/**\n\t * Whether the emoji is animated\n\t */\n\tanimated?: boolean;\n\t/**\n\t * The emoji id to format\n\t */\n\tid: EmojiId;\n\t/**\n\t * The name of the emoji\n\t */\n\tname?: EmojiName;\n}\n\n/**\n * Formats a channel link for a direct message channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @param channelId - The channel's id\n */\nexport function channelLink<ChannelId extends Snowflake>(\n\tchannelId: ChannelId,\n): `https://discord.com/channels/@me/${ChannelId}`;\n\n/**\n * Formats a channel link for a guild channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam GuildId - This is inferred by the supplied guild id\n * @param channelId - The channel's id\n * @param guildId - The guild's id\n */\nexport function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tguildId: GuildId,\n): `https://discord.com/channels/${GuildId}/${ChannelId}`;\n\nexport function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tguildId?: GuildId,\n): `https://discord.com/channels/@me/${ChannelId}` | `https://discord.com/channels/${GuildId}/${ChannelId}` {\n\treturn `https://discord.com/channels/${guildId ?? '@me'}/${channelId}`;\n}\n\n/**\n * Formats a message link for a direct message channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam MessageId - This is inferred by the supplied message id\n * @param channelId - The channel's id\n * @param messageId - The message's id\n */\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n): `https://discord.com/channels/@me/${ChannelId}/${MessageId}`;\n\n/**\n * Formats a message link for a guild channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam MessageId - This is inferred by the supplied message id\n * @typeParam GuildId - This is inferred by the supplied guild id\n * @param channelId - The channel's id\n * @param messageId - The message's id\n * @param guildId - The guild's id\n */\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n\tguildId: GuildId,\n): `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}`;\n\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n\tguildId?: GuildId,\n):\n\t| `https://discord.com/channels/@me/${ChannelId}/${MessageId}`\n\t| `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}` {\n\treturn `${guildId === undefined ? channelLink(channelId) : channelLink(channelId, guildId)}/${messageId}`;\n}\n\n/**\n * The heading levels for expanded markdown.\n */\nexport enum HeadingLevel {\n\t/**\n\t * The first heading level.\n\t */\n\tOne = 1,\n\t/**\n\t * The second heading level.\n\t */\n\tTwo,\n\t/**\n\t * The third heading level.\n\t */\n\tThree,\n}\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level?: HeadingLevel.One): `# ${Content}`;\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level: HeadingLevel.Two): `## ${Content}`;\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level: HeadingLevel.Three): `### ${Content}`;\n\nexport function heading(content: string, level?: HeadingLevel) {\n\t// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n\tswitch (level) {\n\t\tcase HeadingLevel.Three:\n\t\t\treturn `### ${content}`;\n\t\tcase HeadingLevel.Two:\n\t\t\treturn `## ${content}`;\n\t\tdefault:\n\t\t\treturn `# ${content}`;\n\t}\n}\n\n/**\n * A type that recursively traverses into arrays.\n */\nexport type RecursiveArray<ItemType> = readonly (ItemType | RecursiveArray<ItemType>)[];\n\n/**\n * Callback function for list formatters.\n *\n * @internal\n */\nfunction listCallback(element: RecursiveArray<string>, startNumber?: number, depth = 0): string {\n\tif (Array.isArray(element)) {\n\t\treturn element.map((element) => listCallback(element, startNumber, depth + 1)).join('\\n');\n\t}\n\n\treturn `${' '.repeat(depth - 1)}${startNumber ? `${startNumber}.` : '-'} ${element}`;\n}\n\n/**\n * Formats the elements in the array to an ordered list.\n *\n * @param list - The array of elements to list\n * @param startNumber - The starting number for the list\n */\nexport function orderedList(list: RecursiveArray<string>, startNumber = 1): string {\n\treturn listCallback(list, Math.max(startNumber, 1));\n}\n\n/**\n * Formats the elements in the array to an unordered list.\n *\n * @param list - The array of elements to list\n */\nexport function unorderedList(list: RecursiveArray<string>): string {\n\treturn listCallback(list);\n}\n\n/**\n * Formats the content into a subtext.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function subtext<Content extends string>(content: Content): `-# ${Content}` {\n\treturn `-# ${content}`;\n}\n\n/**\n * Formats a date into a short date-time string.\n *\n * @param date - The date to format. Defaults to the current time\n */\nexport function time(date?: Date): `<t:${bigint}>`;\n\n/**\n * Formats a date given a format style.\n *\n * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}\n * @param date - The date to format\n * @param style - The style to use\n */\nexport function time<Style extends TimestampStylesString>(date: Date, style: Style): `<t:${bigint}:${Style}>`;\n\n/**\n * Formats the given timestamp into a short date-time string.\n *\n * @typeParam Seconds - This is inferred by the supplied timestamp\n * @param seconds - A Unix timestamp in seconds\n */\nexport function time<Seconds extends number>(seconds: Seconds): `<t:${Seconds}>`;\n\n/**\n * Formats the given timestamp into a short date-time string.\n *\n * @typeParam Seconds - This is inferred by the supplied timestamp\n * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}\n * @param seconds - A Unix timestamp in seconds\n * @param style - The style to use\n */\nexport function time<Seconds extends number, Style extends TimestampStylesString>(\n\tseconds: Seconds,\n\tstyle: Style,\n): `<t:${Seconds}:${Style}>`;\n\nexport function time(timeOrSeconds?: Date | number, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1_000);\n\t}\n\n\treturn typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;\n}\n\n/**\n * Formats an application directory link.\n *\n * @typeParam ApplicationId - This is inferred by the supplied application id\n * @param applicationId - The application id\n */\nexport function applicationDirectory<ApplicationId extends Snowflake>(\n\tapplicationId: ApplicationId,\n): `https://discord.com/application-directory/${ApplicationId}/store`;\n\n/**\n * Formats an application directory SKU link.\n *\n * @typeParam ApplicationId - This is inferred by the supplied application id\n * @typeParam SKUId - This is inferred by the supplied SKU id\n * @param applicationId - The application id\n * @param skuId - The SKU id\n */\nexport function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(\n\tapplicationId: ApplicationId,\n\tskuId: SKUId,\n): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;\n\nexport function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(\n\tapplicationId: ApplicationId,\n\tskuId?: SKUId,\n):\n\t| `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`\n\t| `https://discord.com/application-directory/${ApplicationId}/store` {\n\tconst url = `https://discord.com/application-directory/${applicationId}/store` as const;\n\treturn skuId ? `${url}/${skuId}` : url;\n}\n\n/**\n * The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}\n * supported by Discord.\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes.\n\t *\n\t * @example `16:20`\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds.\n\t *\n\t * @example `16:20:30`\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year.\n\t *\n\t * @example `20/04/2021`\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year.\n\t *\n\t * @example `20 April 2021`\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats.\n\t *\n\t * @example `20 April 2021 16:20`\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats.\n\t *\n\t * @example `Tuesday, 20 April 2021 16:20`\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format.\n\t *\n\t * @example `2 months ago`\n\t */\n\tRelativeTime: 'R',\n} as const satisfies Record<string, string>;\n\n/**\n * The possible {@link TimestampStyles} values.\n */\nexport type TimestampStylesString = (typeof TimestampStyles)[keyof typeof TimestampStyles];\n\n/**\n * All the available faces from Discord's native slash commands.\n */\nexport enum Faces {\n\t/**\n\t * `¯\\_(ツ)_/¯`\n\t */\n\tShrug = '¯\\\\_(ツ)_/¯',\n\n\t/**\n\t * `(╯°□°)╯︵ ┻━┻`\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * `┬─┬ノ( º _ ºノ)`\n\t */\n\tUnflip = '┬─┬ノ( º _ ºノ)',\n}\n\n/**\n * All the available guild navigation mentions.\n */\nexport enum GuildNavigationMentions {\n\t/**\n\t * Browse Channels tab.\n\t */\n\tBrowse = '<id:browse>',\n\t/**\n\t * Customize tab with the server's {@link https://discord.com/developers/docs/resources/guild#guild-onboarding-object | onboarding prompts}.\n\t */\n\tCustomize = '<id:customize>',\n\t/**\n\t * {@link https://support.discord.com/hc/articles/13497665141655 | Server Guide} tab.\n\t */\n\tGuide = '<id:guide>',\n\t/**\n\t * {@link https://support.discord.com/hc/articles/10388356626711 | Linked Roles} tab.\n\t */\n\tLinkedRoles = '<id:linked-roles>',\n}\n","export * from './escapers.js';\nexport * from './formatters.js';\n\n/**\n * The {@link https://github.com/discordjs/discord.js/blob/main/packages/formatters#readme | @discordjs/formatters} version\n * that you are currently using.\n *\n * @privateRemarks This needs to explicitly be `string` so it is not typed as a \"const string\" that gets injected by esbuild.\n */\nexport const version = '1.0.0-dev.1755777696-4b6060dcd' as string;\n"],"mappings":";;;;AA8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,KAAK,KAAK,IAAI,KAAK,GAAK;AAAA,EAC5E;AAEA,SAAO,OAAO,UAAU,WAAW,MAAM,aAAa,IAAI,KAAK,MAAM,MAAM,aAAa;AACzF;AAPgB;AAgCT,SAAS,qBACf,eACA,OAGqE;AACrE,QAAM,MAAM,6CAA6C,aAAa;AACtE,SAAO,QAAQ,GAAG,GAAG,IAAI,KAAK,KAAK;AACpC;AARgB;AAcT,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOX,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOV,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOX,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOV,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOd,cAAc;AACf;AAUO,IAAK,QAAL,kBAAKC,WAAL;AAIN,EAAAA,OAAA,WAAQ;AAKR,EAAAA,OAAA,eAAY;AAKZ,EAAAA,OAAA,YAAS;AAdE,SAAAA;AAAA,GAAA;AAoBL,IAAK,0BAAL,kBAAKC,6BAAL;AAIN,EAAAA,yBAAA,YAAS;AAIT,EAAAA,yBAAA,eAAY;AAIZ,EAAAA,yBAAA,WAAQ;AAIR,EAAAA,yBAAA,iBAAc;AAhBH,SAAAA;AAAA,GAAA;;;AC9tBL,IAAM,UAAU;","names":["codeBlock","inlineCode","bold","italic","underline","strikethrough","spoiler","heading","HeadingLevel","element","Faces","GuildNavigationMentions"]}
|
|
1
|
+
{"version":3,"sources":["../src/escapers.ts","../src/formatters.ts","../src/index.ts"],"sourcesContent":["/* eslint-disable prefer-named-capture-group */\n\n/**\n * The options that affect what will be escaped.\n */\nexport interface EscapeMarkdownOptions {\n\t/**\n\t * Whether to escape bold text.\n\t *\n\t * @defaultValue `true`\n\t */\n\tbold?: boolean;\n\n\t/**\n\t * Whether to escape bulleted lists.\n\t *\n\t * @defaultValue `true`\n\t */\n\tbulletedList?: boolean;\n\n\t/**\n\t * Whether to escape code blocks.\n\t *\n\t * @defaultValue `true`\n\t */\n\tcodeBlock?: boolean;\n\n\t/**\n\t * Whether to escape text inside code blocks.\n\t *\n\t * @defaultValue `true`\n\t */\n\tcodeBlockContent?: boolean;\n\n\t/**\n\t * Whether to escape `\\`.\n\t *\n\t * @defaultValue `true`\n\t */\n\tescape?: boolean;\n\n\t/**\n\t * Whether to escape headings.\n\t *\n\t * @defaultValue `true`\n\t */\n\theading?: boolean;\n\n\t/**\n\t * Whether to escape inline code.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinlineCode?: boolean;\n\n\t/**\n\t * Whether to escape text inside inline code.\n\t *\n\t * @defaultValue `true`\n\t */\n\tinlineCodeContent?: boolean;\n\t/**\n\t * Whether to escape italics.\n\t *\n\t * @defaultValue `true`\n\t */\n\titalic?: boolean;\n\n\t/**\n\t * Whether to escape masked links.\n\t *\n\t * @defaultValue `true`\n\t */\n\tmaskedLink?: boolean;\n\n\t/**\n\t * Whether to escape numbered lists.\n\t *\n\t * @defaultValue `true`\n\t */\n\tnumberedList?: boolean;\n\n\t/**\n\t * Whether to escape spoilers.\n\t *\n\t * @defaultValue `true`\n\t */\n\tspoiler?: boolean;\n\n\t/**\n\t * Whether to escape strikethroughs.\n\t *\n\t * @defaultValue `true`\n\t */\n\tstrikethrough?: boolean;\n\n\t/**\n\t * Whether to escape underlines.\n\t *\n\t * @defaultValue `true`\n\t */\n\tunderline?: boolean;\n}\n\n/**\n * Escapes any Discord-flavored markdown in a string.\n *\n * @param text - Content to escape\n * @param options - Options for escaping the markdown\n */\nexport function escapeMarkdown(text: string, options: EscapeMarkdownOptions = {}): string {\n\tconst {\n\t\tcodeBlock = true,\n\t\tinlineCode = true,\n\t\tbold = true,\n\t\titalic = true,\n\t\tunderline = true,\n\t\tstrikethrough = true,\n\t\tspoiler = true,\n\t\tcodeBlockContent = true,\n\t\tinlineCodeContent = true,\n\t\tescape = true,\n\t\theading = true,\n\t\tbulletedList = true,\n\t\tnumberedList = true,\n\t\tmaskedLink = true,\n\t} = options;\n\n\tif (!codeBlockContent) {\n\t\treturn text\n\t\t\t.split('```')\n\t\t\t.map((subString, index, array) => {\n\t\t\t\tif (index % 2 && index !== array.length - 1) return subString;\n\t\t\t\treturn escapeMarkdown(subString, {\n\t\t\t\t\tinlineCode,\n\t\t\t\t\tbold,\n\t\t\t\t\titalic,\n\t\t\t\t\tunderline,\n\t\t\t\t\tstrikethrough,\n\t\t\t\t\tspoiler,\n\t\t\t\t\tinlineCodeContent,\n\t\t\t\t\tescape,\n\t\t\t\t\theading,\n\t\t\t\t\tbulletedList,\n\t\t\t\t\tnumberedList,\n\t\t\t\t\tmaskedLink,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.join(codeBlock ? '\\\\`\\\\`\\\\`' : '```');\n\t}\n\n\tif (!inlineCodeContent) {\n\t\treturn text\n\t\t\t.split(/(?<=^|[^`])`(?=[^`]|$)/g)\n\t\t\t.map((subString, index, array) => {\n\t\t\t\tif (index % 2 && index !== array.length - 1) return subString;\n\t\t\t\treturn escapeMarkdown(subString, {\n\t\t\t\t\tcodeBlock,\n\t\t\t\t\tbold,\n\t\t\t\t\titalic,\n\t\t\t\t\tunderline,\n\t\t\t\t\tstrikethrough,\n\t\t\t\t\tspoiler,\n\t\t\t\t\tescape,\n\t\t\t\t\theading,\n\t\t\t\t\tbulletedList,\n\t\t\t\t\tnumberedList,\n\t\t\t\t\tmaskedLink,\n\t\t\t\t});\n\t\t\t})\n\t\t\t.join(inlineCode ? '\\\\`' : '`');\n\t}\n\n\tlet res = text;\n\tif (escape) res = escapeEscape(res);\n\tif (inlineCode) res = escapeInlineCode(res);\n\tif (codeBlock) res = escapeCodeBlock(res);\n\tif (italic) res = escapeItalic(res);\n\tif (bold) res = escapeBold(res);\n\tif (underline) res = escapeUnderline(res);\n\tif (strikethrough) res = escapeStrikethrough(res);\n\tif (spoiler) res = escapeSpoiler(res);\n\tif (heading) res = escapeHeading(res);\n\tif (bulletedList) res = escapeBulletedList(res);\n\tif (numberedList) res = escapeNumberedList(res);\n\tif (maskedLink) res = escapeMaskedLink(res);\n\treturn res;\n}\n\n/**\n * Escapes code block markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeCodeBlock(text: string): string {\n\treturn text.replaceAll('```', '\\\\`\\\\`\\\\`');\n}\n\n/**\n * Escapes inline code markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeInlineCode(text: string): string {\n\treturn text.replaceAll(/(?<=^|[^`])``?(?=[^`]|$)/g, (match) => (match.length === 2 ? '\\\\`\\\\`' : '\\\\`'));\n}\n\n/**\n * Escapes italic markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeItalic(text: string): string {\n\tlet idx = 0;\n\tconst newText = text.replaceAll(/(?<=^|[^*])\\*([^*]|\\*\\*|$)/g, (_, match) => {\n\t\tif (match === '**') return ++idx % 2 ? `\\\\*${match}` : `${match}\\\\*`;\n\t\treturn `\\\\*${match}`;\n\t});\n\tidx = 0;\n\treturn newText.replaceAll(/(?<=^|[^_])(?<!<a?:.+|https?:\\/\\/\\S+)_(?!:\\d+>)([^_]|__|$)/g, (_, match) => {\n\t\tif (match === '__') return ++idx % 2 ? `\\\\_${match}` : `${match}\\\\_`;\n\t\treturn `\\\\_${match}`;\n\t});\n}\n\n/**\n * Escapes bold markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBold(text: string): string {\n\tlet idx = 0;\n\treturn text.replaceAll(/\\*\\*(\\*)?/g, (_, match) => {\n\t\tif (match) return ++idx % 2 ? `${match}\\\\*\\\\*` : `\\\\*\\\\*${match}`;\n\t\treturn '\\\\*\\\\*';\n\t});\n}\n\n/**\n * Escapes underline markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeUnderline(text: string): string {\n\tlet idx = 0;\n\treturn text.replaceAll(/(?<!<a?:.+|https?:\\/\\/\\S+)__(_)?(?!:\\d+>)/g, (_, match) => {\n\t\tif (match) return ++idx % 2 ? `${match}\\\\_\\\\_` : `\\\\_\\\\_${match}`;\n\t\treturn '\\\\_\\\\_';\n\t});\n}\n\n/**\n * Escapes strikethrough markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeStrikethrough(text: string): string {\n\treturn text.replaceAll('~~', '\\\\~\\\\~');\n}\n\n/**\n * Escapes spoiler markdown in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeSpoiler(text: string): string {\n\treturn text.replaceAll('||', '\\\\|\\\\|');\n}\n\n/**\n * Escapes escape characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeEscape(text: string): string {\n\treturn text.replaceAll('\\\\', '\\\\\\\\');\n}\n\n/**\n * Escapes heading characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeHeading(text: string): string {\n\treturn text.replaceAll(/^( {0,2})([*-] )?( *)(#{1,3} )/gm, '$1$2$3\\\\$4');\n}\n\n/**\n * Escapes bulleted list characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBulletedList(text: string): string {\n\treturn text.replaceAll(/^( *)([*-])( +)/gm, '$1\\\\$2$3');\n}\n\n/**\n * Escapes numbered list characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeNumberedList(text: string): string {\n\treturn text.replaceAll(/^( *\\d+)\\./gm, '$1\\\\.');\n}\n\n/**\n * Escapes masked link characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeMaskedLink(text: string): string {\n\treturn text.replaceAll(/\\[.+]\\(.+\\)/gm, '\\\\$&');\n}\n","import type { URL } from 'node:url';\nimport type { Snowflake } from 'discord-api-types/globals';\n\n/**\n * Wraps the content inside a code block with no language.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function codeBlock<Content extends string>(content: Content): `\\`\\`\\`\\n${Content}\\n\\`\\`\\``;\n\n/**\n * Wraps the content inside a code block with the specified language.\n *\n * @typeParam Language - This is inferred by the supplied language\n * @typeParam Content - This is inferred by the supplied content\n * @param language - The language for the code block\n * @param content - The content to wrap\n */\nexport function codeBlock<Language extends string, Content extends string>(\n\tlanguage: Language,\n\tcontent: Content,\n): `\\`\\`\\`${Language}\\n${Content}\\n\\`\\`\\``;\n\nexport function codeBlock(language: string, content?: string): string {\n\treturn content === undefined ? `\\`\\`\\`\\n${language}\\n\\`\\`\\`` : `\\`\\`\\`${language}\\n${content}\\n\\`\\`\\``;\n}\n\n/**\n * Wraps the content inside \\`backticks\\` which formats it as inline code.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function inlineCode<Content extends string>(content: Content): `\\`${Content}\\`` {\n\treturn `\\`${content}\\``;\n}\n\n/**\n * Formats the content into italic text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function italic<Content extends string>(content: Content): `_${Content}_` {\n\treturn `_${content}_`;\n}\n\n/**\n * Formats the content into bold text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function bold<Content extends string>(content: Content): `**${Content}**` {\n\treturn `**${content}**`;\n}\n\n/**\n * Formats the content into underlined text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function underline<Content extends string>(content: Content): `__${Content}__` {\n\treturn `__${content}__`;\n}\n\n/**\n * Formats the content into strike-through text.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function strikethrough<Content extends string>(content: Content): `~~${Content}~~` {\n\treturn `~~${content}~~`;\n}\n\n/**\n * Formats the content into a quote.\n *\n * @remarks This needs to be at the start of the line for Discord to format it.\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function quote<Content extends string>(content: Content): `> ${Content}` {\n\treturn `> ${content}`;\n}\n\n/**\n * Formats the content into a block quote.\n *\n * @remarks This needs to be at the start of the line for Discord to format it.\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function blockQuote<Content extends string>(content: Content): `>>> ${Content}` {\n\treturn `>>> ${content}`;\n}\n\n/**\n * Wraps the URL into `<>` which stops it from embedding.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param url - The URL to wrap\n */\nexport function hideLinkEmbed<Content extends string>(url: Content): `<${Content}>`;\n\n/**\n * Wraps the URL into `<>` which stops it from embedding.\n *\n * @param url - The URL to wrap\n */\nexport function hideLinkEmbed(url: URL): `<${string}>`;\n\nexport function hideLinkEmbed(url: URL | string) {\n\treturn `<${url}>`;\n}\n\n/**\n * Formats the content and the URL into a masked URL.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to display\n * @param url - The URL the content links to\n */\nexport function hyperlink<Content extends string>(content: Content, url: URL): `[${Content}](${string})`;\n\n/**\n * Formats the content and the URL into a masked URL.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Url - This is inferred by the supplied URL\n * @param content - The content to display\n * @param url - The URL the content links to\n */\nexport function hyperlink<Content extends string, Url extends string>(\n\tcontent: Content,\n\turl: Url,\n): `[${Content}](${Url})`;\n\n/**\n * Formats the content and the URL into a masked URL with a custom tooltip.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Title - This is inferred by the supplied title\n * @param content - The content to display\n * @param url - The URL the content links to\n * @param title - The title shown when hovering on the masked link\n */\nexport function hyperlink<Content extends string, Title extends string>(\n\tcontent: Content,\n\turl: URL,\n\ttitle: Title,\n): `[${Content}](${string} \"${Title}\")`;\n\n/**\n * Formats the content and the URL into a masked URL with a custom tooltip.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @typeParam Url - This is inferred by the supplied URL\n * @typeParam Title - This is inferred by the supplied title\n * @param content - The content to display\n * @param url - The URL the content links to\n * @param title - The title shown when hovering on the masked link\n */\nexport function hyperlink<Content extends string, Url extends string, Title extends string>(\n\tcontent: Content,\n\turl: Url,\n\ttitle: Title,\n): `[${Content}](${Url} \"${Title}\")`;\n\nexport function hyperlink(content: string, url: URL | string, title?: string) {\n\treturn title ? `[${content}](${url} \"${title}\")` : `[${content}](${url})`;\n}\n\n/**\n * Formats the content into a spoiler.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function spoiler<Content extends string>(content: Content): `||${Content}||` {\n\treturn `||${content}||`;\n}\n\n/**\n * Formats a user id into a user mention.\n *\n * @typeParam UserId - This is inferred by the supplied user id\n * @param userId - The user id to format\n */\nexport function userMention<UserId extends Snowflake>(userId: UserId): `<@${UserId}>` {\n\treturn `<@${userId}>`;\n}\n\n/**\n * Formats a channel id into a channel mention.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @param channelId - The channel id to format\n */\nexport function channelMention<ChannelId extends Snowflake>(channelId: ChannelId): `<#${ChannelId}>` {\n\treturn `<#${channelId}>`;\n}\n\n/**\n * Formats a role id into a role mention.\n *\n * @typeParam RoleId - This is inferred by the supplied role id\n * @param roleId - The role id to format\n */\nexport function roleMention<RoleId extends Snowflake>(roleId: RoleId): `<@&${RoleId}>` {\n\treturn `<@&${roleId}>`;\n}\n\n/**\n * Formats a role id into a linked role mention.\n *\n * @typeParam RoleId - This is inferred by the supplied role id\n * @param roleId - The role id to format\n */\nexport function linkedRoleMention<RoleId extends Snowflake>(roleId: RoleId): `<id:linked-roles:${RoleId}>` {\n\treturn `<id:linked-roles:${roleId}>`;\n}\n\n/**\n * Formats an application command name and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n */\nexport function chatInputApplicationCommandMention<CommandId extends Snowflake, CommandName extends string>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n): `</${CommandName}:${CommandId}>`;\n\n/**\n * Formats an application command name, subcommand name, and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @typeParam SubcommandName - This is inferred by the supplied subcommand name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n * @param subcommandName - The subcommand name to format\n */\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName: SubcommandName,\n): `</${CommandName} ${SubcommandName}:${CommandId}>`;\n\n/**\n * Formats an application command name, subcommand group name, subcommand name, and id into an application command mention.\n *\n * @typeParam CommandId - This is inferred by the supplied command id\n * @typeParam CommandName - This is inferred by the supplied command name\n * @typeParam SubcommandName - This is inferred by the supplied subcommand name\n * @typeParam SubcommandGroupName - This is inferred by the supplied subcommand group name\n * @param commandId - The application command id to format\n * @param commandName - The application command name to format\n * @param subcommandName - The subcommand name to format\n * @param subcommandGroupName - The subcommand group name to format\n */\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n\tSubcommandGroupName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName: SubcommandName,\n\tsubcommandGroupName: SubcommandGroupName,\n): `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`;\n\nexport function chatInputApplicationCommandMention<\n\tCommandId extends Snowflake,\n\tCommandName extends string,\n\tSubcommandName extends string,\n\tSubcommandGroupName extends string,\n>(\n\tcommandId: CommandId,\n\tcommandName: CommandName,\n\tsubcommandName?: SubcommandName | undefined,\n\tsubcommandGroupName?: SubcommandGroupName | undefined,\n):\n\t| `</${CommandName} ${SubcommandGroupName} ${SubcommandName}:${CommandId}>`\n\t| `</${CommandName} ${SubcommandName}:${CommandId}>`\n\t| `</${CommandName}:${CommandId}>` {\n\tif (subcommandGroupName !== undefined && subcommandName !== undefined) {\n\t\treturn `</${commandName} ${subcommandGroupName} ${subcommandName}:${commandId}>`;\n\t}\n\n\tif (subcommandName !== undefined) {\n\t\treturn `</${commandName} ${subcommandName}:${commandId}>`;\n\t}\n\n\treturn `</${commandName}:${commandId}>`;\n}\n\n/**\n * Formats a non-animated emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n */\nexport function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:emoji:${EmojiId}>`;\n\n/**\n * Formats an animated emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n * @param animated - Whether the emoji is animated\n */\nexport function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:emoji:${EmojiId}>`;\n\n/**\n * Formats an emoji id into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @param emojiId - The emoji id to format\n * @param animated - Whether the emoji is animated\n */\nexport function formatEmoji<EmojiId extends Snowflake>(\n\temojiId: EmojiId,\n\tanimated?: boolean,\n): `<:emoji:${EmojiId}>` | `<a:emoji:${EmojiId}>`;\n\n/**\n * Formats a non-animated emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName> & { animated: true },\n): `<a:${EmojiName}:${EmojiId}>`;\n\n/**\n * Formats an animated emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName> & { animated?: false },\n): `<:${EmojiName}:${EmojiId}>`;\n\n/**\n * Formats an emoji id and name into a fully qualified emoji identifier.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied emoji name\n * @param options - The options for formatting an emoji\n */\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\toptions: FormatEmojiOptions<EmojiId, EmojiName>,\n): `<:${EmojiName}:${EmojiId}>` | `<a:${EmojiName}:${EmojiId}>`;\n\nexport function formatEmoji<EmojiId extends Snowflake, EmojiName extends string>(\n\temojiIdOrOptions: EmojiId | FormatEmojiOptions<EmojiId, EmojiName>,\n\tanimated?: boolean,\n): `<:${string}:${EmojiId}>` | `<a:${string}:${EmojiId}>` {\n\tconst options =\n\t\ttypeof emojiIdOrOptions === 'string'\n\t\t\t? {\n\t\t\t\t\tid: emojiIdOrOptions,\n\t\t\t\t\tanimated: animated ?? false,\n\t\t\t\t}\n\t\t\t: emojiIdOrOptions;\n\n\tconst { id, animated: isAnimated, name: emojiName } = options;\n\n\treturn `<${isAnimated ? 'a' : ''}:${emojiName ?? 'emoji'}:${id}>`;\n}\n\n/**\n * The options for formatting an emoji.\n *\n * @typeParam EmojiId - This is inferred by the supplied emoji id\n * @typeParam EmojiName - This is inferred by the supplied emoji name\n */\nexport interface FormatEmojiOptions<EmojiId extends Snowflake, EmojiName extends string> {\n\t/**\n\t * Whether the emoji is animated\n\t */\n\tanimated?: boolean;\n\t/**\n\t * The emoji id to format\n\t */\n\tid: EmojiId;\n\t/**\n\t * The name of the emoji\n\t */\n\tname?: EmojiName;\n}\n\n/**\n * Formats a channel link for a direct message channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @param channelId - The channel's id\n */\nexport function channelLink<ChannelId extends Snowflake>(\n\tchannelId: ChannelId,\n): `https://discord.com/channels/@me/${ChannelId}`;\n\n/**\n * Formats a channel link for a guild channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam GuildId - This is inferred by the supplied guild id\n * @param channelId - The channel's id\n * @param guildId - The guild's id\n */\nexport function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tguildId: GuildId,\n): `https://discord.com/channels/${GuildId}/${ChannelId}`;\n\nexport function channelLink<ChannelId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tguildId?: GuildId,\n): `https://discord.com/channels/@me/${ChannelId}` | `https://discord.com/channels/${GuildId}/${ChannelId}` {\n\treturn `https://discord.com/channels/${guildId ?? '@me'}/${channelId}`;\n}\n\n/**\n * Formats a message link for a direct message channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam MessageId - This is inferred by the supplied message id\n * @param channelId - The channel's id\n * @param messageId - The message's id\n */\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n): `https://discord.com/channels/@me/${ChannelId}/${MessageId}`;\n\n/**\n * Formats a message link for a guild channel.\n *\n * @typeParam ChannelId - This is inferred by the supplied channel id\n * @typeParam MessageId - This is inferred by the supplied message id\n * @typeParam GuildId - This is inferred by the supplied guild id\n * @param channelId - The channel's id\n * @param messageId - The message's id\n * @param guildId - The guild's id\n */\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n\tguildId: GuildId,\n): `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}`;\n\nexport function messageLink<ChannelId extends Snowflake, MessageId extends Snowflake, GuildId extends Snowflake>(\n\tchannelId: ChannelId,\n\tmessageId: MessageId,\n\tguildId?: GuildId,\n):\n\t| `https://discord.com/channels/@me/${ChannelId}/${MessageId}`\n\t| `https://discord.com/channels/${GuildId}/${ChannelId}/${MessageId}` {\n\treturn `${guildId === undefined ? channelLink(channelId) : channelLink(channelId, guildId)}/${messageId}`;\n}\n\n/**\n * The heading levels for expanded markdown.\n */\nexport enum HeadingLevel {\n\t/**\n\t * The first heading level.\n\t */\n\tOne = 1,\n\t/**\n\t * The second heading level.\n\t */\n\tTwo,\n\t/**\n\t * The third heading level.\n\t */\n\tThree,\n}\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level?: HeadingLevel.One): `# ${Content}`;\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level: HeadingLevel.Two): `## ${Content}`;\n\n/**\n * Formats the content into a heading level.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n * @param level - The heading level\n */\nexport function heading<Content extends string>(content: Content, level: HeadingLevel.Three): `### ${Content}`;\n\nexport function heading(content: string, level?: HeadingLevel) {\n\t// eslint-disable-next-line @typescript-eslint/switch-exhaustiveness-check\n\tswitch (level) {\n\t\tcase HeadingLevel.Three:\n\t\t\treturn `### ${content}`;\n\t\tcase HeadingLevel.Two:\n\t\t\treturn `## ${content}`;\n\t\tdefault:\n\t\t\treturn `# ${content}`;\n\t}\n}\n\n/**\n * A type that recursively traverses into arrays.\n */\nexport type RecursiveArray<ItemType> = readonly (ItemType | RecursiveArray<ItemType>)[];\n\n/**\n * Callback function for list formatters.\n *\n * @internal\n */\nfunction listCallback(element: RecursiveArray<string>, startNumber?: number, depth = 0): string {\n\tif (Array.isArray(element)) {\n\t\treturn element.map((element) => listCallback(element, startNumber, depth + 1)).join('\\n');\n\t}\n\n\treturn `${' '.repeat(depth - 1)}${startNumber ? `${startNumber}.` : '-'} ${element}`;\n}\n\n/**\n * Formats the elements in the array to an ordered list.\n *\n * @param list - The array of elements to list\n * @param startNumber - The starting number for the list\n */\nexport function orderedList(list: RecursiveArray<string>, startNumber = 1): string {\n\treturn listCallback(list, Math.max(startNumber, 1));\n}\n\n/**\n * Formats the elements in the array to an unordered list.\n *\n * @param list - The array of elements to list\n */\nexport function unorderedList(list: RecursiveArray<string>): string {\n\treturn listCallback(list);\n}\n\n/**\n * Formats the content into a subtext.\n *\n * @typeParam Content - This is inferred by the supplied content\n * @param content - The content to wrap\n */\nexport function subtext<Content extends string>(content: Content): `-# ${Content}` {\n\treturn `-# ${content}`;\n}\n\n/**\n * Formats a date into a short date-time string.\n *\n * @param date - The date to format. Defaults to the current time\n */\nexport function time(date?: Date): `<t:${bigint}>`;\n\n/**\n * Formats a date given a format style.\n *\n * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}\n * @param date - The date to format\n * @param style - The style to use\n */\nexport function time<Style extends TimestampStylesString>(date: Date, style: Style): `<t:${bigint}:${Style}>`;\n\n/**\n * Formats the given timestamp into a short date-time string.\n *\n * @typeParam Seconds - This is inferred by the supplied timestamp\n * @param seconds - A Unix timestamp in seconds\n */\nexport function time<Seconds extends number>(seconds: Seconds): `<t:${Seconds}>`;\n\n/**\n * Formats the given timestamp into a short date-time string.\n *\n * @typeParam Seconds - This is inferred by the supplied timestamp\n * @typeParam Style - This is inferred by the supplied {@link TimestampStylesString}\n * @param seconds - A Unix timestamp in seconds\n * @param style - The style to use\n */\nexport function time<Seconds extends number, Style extends TimestampStylesString>(\n\tseconds: Seconds,\n\tstyle: Style,\n): `<t:${Seconds}:${Style}>`;\n\nexport function time(timeOrSeconds?: Date | number, style?: TimestampStylesString): string {\n\tif (typeof timeOrSeconds !== 'number') {\n\t\t// eslint-disable-next-line no-param-reassign\n\t\ttimeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1_000);\n\t}\n\n\treturn typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;\n}\n\n/**\n * Formats an application directory link.\n *\n * @typeParam ApplicationId - This is inferred by the supplied application id\n * @param applicationId - The application id\n */\nexport function applicationDirectory<ApplicationId extends Snowflake>(\n\tapplicationId: ApplicationId,\n): `https://discord.com/application-directory/${ApplicationId}/store`;\n\n/**\n * Formats an application directory SKU link.\n *\n * @typeParam ApplicationId - This is inferred by the supplied application id\n * @typeParam SKUId - This is inferred by the supplied SKU id\n * @param applicationId - The application id\n * @param skuId - The SKU id\n */\nexport function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(\n\tapplicationId: ApplicationId,\n\tskuId: SKUId,\n): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;\n\nexport function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(\n\tapplicationId: ApplicationId,\n\tskuId?: SKUId,\n):\n\t| `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`\n\t| `https://discord.com/application-directory/${ApplicationId}/store` {\n\tconst url = `https://discord.com/application-directory/${applicationId}/store` as const;\n\treturn skuId ? `${url}/${skuId}` : url;\n}\n\n/**\n * Formats an email address into an email mention.\n *\n * @typeParam Email - This is inferred by the supplied email address\n * @param email - The email address to format\n */\nexport function email<Email extends string>(email: Email): `<${Email}>`;\n\n/**\n * Formats an email address and headers into an email mention.\n *\n * @typeParam Email - This is inferred by the supplied email address\n * @param email - The email address to format\n * @param headers - Optional headers to include in the email mention\n */\nexport function email<Email extends string>(\n\temail: Email,\n\theaders: Record<string, string | readonly string[]> | undefined,\n): `<${Email}?${string}>`;\n\n/**\n * Formats an email address into an email mention.\n *\n * @typeParam Email - This is inferred by the supplied email address\n * @param email - The email address to format\n * @param headers - Optional headers to include in the email mention\n */\nexport function email<Email extends string>(email: Email, headers?: Record<string, string | readonly string[]>) {\n\tif (headers) {\n\t\t// eslint-disable-next-line n/prefer-global/url-search-params\n\t\tconst searchParams = new URLSearchParams(\n\t\t\tObject.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value])),\n\t\t);\n\n\t\treturn `<${email}?${searchParams.toString()}>` as const;\n\t}\n\n\treturn `<${email}>` as const;\n}\n\n/**\n * Formats a phone number into a phone number mention.\n *\n * @typeParam PhoneNumber - This is inferred by the supplied phone number\n * @param phoneNumber - The phone number to format. Must start with a `+` sign.\n */\nexport function phoneNumber<PhoneNumber extends `+${string}`>(phoneNumber: PhoneNumber) {\n\tif (!phoneNumber.startsWith('+')) {\n\t\tthrow new Error('Phone number must start with a \"+\" sign.');\n\t}\n\n\treturn `<${phoneNumber}>` as const;\n}\n\n/**\n * The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}\n * supported by Discord.\n */\nexport const TimestampStyles = {\n\t/**\n\t * Short time format, consisting of hours and minutes.\n\t *\n\t * @example `16:20`\n\t */\n\tShortTime: 't',\n\n\t/**\n\t * Long time format, consisting of hours, minutes, and seconds.\n\t *\n\t * @example `16:20:30`\n\t */\n\tLongTime: 'T',\n\n\t/**\n\t * Short date format, consisting of day, month, and year.\n\t *\n\t * @example `20/04/2021`\n\t */\n\tShortDate: 'd',\n\n\t/**\n\t * Long date format, consisting of day, month, and year.\n\t *\n\t * @example `20 April 2021`\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Short date-time format, consisting of short date and short time formats.\n\t *\n\t * @example `20 April 2021 16:20`\n\t */\n\tShortDateTime: 'f',\n\n\t/**\n\t * Long date-time format, consisting of long date and short time formats.\n\t *\n\t * @example `Tuesday, 20 April 2021 16:20`\n\t */\n\tLongDateTime: 'F',\n\n\t/**\n\t * Relative time format, consisting of a relative duration format.\n\t *\n\t * @example `2 months ago`\n\t */\n\tRelativeTime: 'R',\n} as const satisfies Record<string, string>;\n\n/**\n * The possible {@link TimestampStyles} values.\n */\nexport type TimestampStylesString = (typeof TimestampStyles)[keyof typeof TimestampStyles];\n\n/**\n * All the available faces from Discord's native slash commands.\n */\nexport enum Faces {\n\t/**\n\t * `¯\\_(ツ)_/¯`\n\t */\n\tShrug = '¯\\\\_(ツ)_/¯',\n\n\t/**\n\t * `(╯°□°)╯︵ ┻━┻`\n\t */\n\tTableflip = '(╯°□°)╯︵ ┻━┻',\n\n\t/**\n\t * `┬─┬ノ( º _ ºノ)`\n\t */\n\tUnflip = '┬─┬ノ( º _ ºノ)',\n}\n\n/**\n * All the available guild navigation mentions.\n */\nexport enum GuildNavigationMentions {\n\t/**\n\t * Browse Channels tab.\n\t */\n\tBrowse = '<id:browse>',\n\t/**\n\t * Customize tab with the server's {@link https://discord.com/developers/docs/resources/guild#guild-onboarding-object | onboarding prompts}.\n\t */\n\tCustomize = '<id:customize>',\n\t/**\n\t * {@link https://support.discord.com/hc/articles/13497665141655 | Server Guide} tab.\n\t */\n\tGuide = '<id:guide>',\n\t/**\n\t * {@link https://support.discord.com/hc/articles/10388356626711 | Linked Roles} tab.\n\t */\n\tLinkedRoles = '<id:linked-roles>',\n}\n","export * from './escapers.js';\nexport * from './formatters.js';\n\n/**\n * The {@link https://github.com/discordjs/discord.js/blob/main/packages/formatters#readme | @discordjs/formatters} version\n * that you are currently using.\n *\n * @privateRemarks This needs to explicitly be `string` so it is not typed as a \"const string\" that gets injected by esbuild.\n */\nexport const version = '1.0.0-dev.1756252914-50018979e' as string;\n"],"mappings":";;;;AA8GO,SAAS,eAAe,MAAc,UAAiC,CAAC,GAAW;AACzF,QAAM;AAAA,IACL,WAAAA,aAAY;AAAA,IACZ,YAAAC,cAAa;AAAA,IACb,MAAAC,QAAO;AAAA,IACP,QAAAC,UAAS;AAAA,IACT,WAAAC,aAAY;AAAA,IACZ,eAAAC,iBAAgB;AAAA,IAChB,SAAAC,WAAU;AAAA,IACV,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,SAAS;AAAA,IACT,SAAAC,WAAU;AAAA,IACV,eAAe;AAAA,IACf,eAAe;AAAA,IACf,aAAa;AAAA,EACd,IAAI;AAEJ,MAAI,CAAC,kBAAkB;AACtB,WAAO,KACL,MAAM,KAAK,EACX,IAAI,CAAC,WAAW,OAAO,UAAU;AACjC,UAAI,QAAQ,KAAK,UAAU,MAAM,SAAS,EAAG,QAAO;AACpD,aAAO,eAAe,WAAW;AAAA,QAChC,YAAAN;AAAA,QACA,MAAAC;AAAA,QACA,QAAAC;AAAA,QACA,WAAAC;AAAA,QACA,eAAAC;AAAA,QACA,SAAAC;AAAA,QACA;AAAA,QACA;AAAA,QACA,SAAAC;AAAA,QACA;AAAA,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AAW;AACvB;AANgB;AAYT,IAAM,kBAAkB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM9B,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOX,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOV,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOX,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOV,eAAe;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOf,cAAc;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOd,cAAc;AACf;AAUO,IAAK,QAAL,kBAAKC,WAAL;AAIN,EAAAA,OAAA,WAAQ;AAKR,EAAAA,OAAA,eAAY;AAKZ,EAAAA,OAAA,YAAS;AAdE,SAAAA;AAAA,GAAA;AAoBL,IAAK,0BAAL,kBAAKC,6BAAL;AAIN,EAAAA,yBAAA,YAAS;AAIT,EAAAA,yBAAA,eAAY;AAIZ,EAAAA,yBAAA,WAAQ;AAIR,EAAAA,yBAAA,iBAAc;AAhBH,SAAAA;AAAA,GAAA;;;ACpxBL,IAAM,UAAU;","names":["codeBlock","inlineCode","bold","italic","underline","strikethrough","spoiler","heading","HeadingLevel","element","email","phoneNumber","Faces","GuildNavigationMentions"]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package.json",
|
|
3
3
|
"name": "@discordjs/formatters",
|
|
4
|
-
"version": "1.0.0-dev.
|
|
4
|
+
"version": "1.0.0-dev.1756252914-50018979e",
|
|
5
5
|
"description": "A set of functions to format strings for Discord.",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|