@discordjs/formatters 1.0.0-move-client-init.1761650119-a4c0a246f → 1.0.0-pr-11006.1765450224-e636950b2
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 +21 -10
- package/dist/index.d.ts +21 -10
- package/dist/index.js +36 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +36 -18
- package/dist/index.mjs.map +1 -1
- package/package.json +14 -14
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { URL } from 'node:url';
|
|
2
1
|
import { Snowflake } from 'discord-api-types/globals';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -632,11 +631,11 @@ declare const TimestampStyles: {
|
|
|
632
631
|
*/
|
|
633
632
|
readonly ShortTime: "t";
|
|
634
633
|
/**
|
|
635
|
-
*
|
|
634
|
+
* Medium time format, consisting of hours, minutes, and seconds.
|
|
636
635
|
*
|
|
637
636
|
* @example `16:20:30`
|
|
638
637
|
*/
|
|
639
|
-
readonly
|
|
638
|
+
readonly MediumTime: "T";
|
|
640
639
|
/**
|
|
641
640
|
* Short date format, consisting of day, month, and year.
|
|
642
641
|
*
|
|
@@ -646,21 +645,33 @@ declare const TimestampStyles: {
|
|
|
646
645
|
/**
|
|
647
646
|
* Long date format, consisting of day, month, and year.
|
|
648
647
|
*
|
|
649
|
-
* @example `20
|
|
648
|
+
* @example `April 20, 2021`
|
|
650
649
|
*/
|
|
651
650
|
readonly LongDate: "D";
|
|
652
651
|
/**
|
|
653
|
-
*
|
|
652
|
+
* Long date-short time format, consisting of long date and short time.
|
|
654
653
|
*
|
|
655
|
-
* @example `20
|
|
654
|
+
* @example `April 20, 2021 at 16:20`
|
|
656
655
|
*/
|
|
657
|
-
readonly
|
|
656
|
+
readonly LongDateShortTime: "f";
|
|
658
657
|
/**
|
|
659
|
-
*
|
|
658
|
+
* Full date-short time format, consisting of full date and short time.
|
|
660
659
|
*
|
|
661
|
-
* @example `Tuesday, 20
|
|
660
|
+
* @example `Tuesday, April 20, 2021 at 16:20`
|
|
662
661
|
*/
|
|
663
|
-
readonly
|
|
662
|
+
readonly FullDateShortTime: "F";
|
|
663
|
+
/**
|
|
664
|
+
* Short date, short time format, consisting of short date and short time.
|
|
665
|
+
*
|
|
666
|
+
* @example `20/04/2021, 16:20`
|
|
667
|
+
*/
|
|
668
|
+
readonly ShortDateShortTime: "s";
|
|
669
|
+
/**
|
|
670
|
+
* Short date, medium time format, consisting of short date and medium time.
|
|
671
|
+
*
|
|
672
|
+
* @example `20/04/2021, 16:20:30`
|
|
673
|
+
*/
|
|
674
|
+
readonly ShortDateMediumTime: "S";
|
|
664
675
|
/**
|
|
665
676
|
* Relative time format, consisting of a relative duration format.
|
|
666
677
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { URL } from 'node:url';
|
|
2
1
|
import { Snowflake } from 'discord-api-types/globals';
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -632,11 +631,11 @@ declare const TimestampStyles: {
|
|
|
632
631
|
*/
|
|
633
632
|
readonly ShortTime: "t";
|
|
634
633
|
/**
|
|
635
|
-
*
|
|
634
|
+
* Medium time format, consisting of hours, minutes, and seconds.
|
|
636
635
|
*
|
|
637
636
|
* @example `16:20:30`
|
|
638
637
|
*/
|
|
639
|
-
readonly
|
|
638
|
+
readonly MediumTime: "T";
|
|
640
639
|
/**
|
|
641
640
|
* Short date format, consisting of day, month, and year.
|
|
642
641
|
*
|
|
@@ -646,21 +645,33 @@ declare const TimestampStyles: {
|
|
|
646
645
|
/**
|
|
647
646
|
* Long date format, consisting of day, month, and year.
|
|
648
647
|
*
|
|
649
|
-
* @example `20
|
|
648
|
+
* @example `April 20, 2021`
|
|
650
649
|
*/
|
|
651
650
|
readonly LongDate: "D";
|
|
652
651
|
/**
|
|
653
|
-
*
|
|
652
|
+
* Long date-short time format, consisting of long date and short time.
|
|
654
653
|
*
|
|
655
|
-
* @example `20
|
|
654
|
+
* @example `April 20, 2021 at 16:20`
|
|
656
655
|
*/
|
|
657
|
-
readonly
|
|
656
|
+
readonly LongDateShortTime: "f";
|
|
658
657
|
/**
|
|
659
|
-
*
|
|
658
|
+
* Full date-short time format, consisting of full date and short time.
|
|
660
659
|
*
|
|
661
|
-
* @example `Tuesday, 20
|
|
660
|
+
* @example `Tuesday, April 20, 2021 at 16:20`
|
|
662
661
|
*/
|
|
663
|
-
readonly
|
|
662
|
+
readonly FullDateShortTime: "F";
|
|
663
|
+
/**
|
|
664
|
+
* Short date, short time format, consisting of short date and short time.
|
|
665
|
+
*
|
|
666
|
+
* @example `20/04/2021, 16:20`
|
|
667
|
+
*/
|
|
668
|
+
readonly ShortDateShortTime: "s";
|
|
669
|
+
/**
|
|
670
|
+
* Short date, medium time format, consisting of short date and medium time.
|
|
671
|
+
*
|
|
672
|
+
* @example `20/04/2021, 16:20:30`
|
|
673
|
+
*/
|
|
674
|
+
readonly ShortDateMediumTime: "S";
|
|
664
675
|
/**
|
|
665
676
|
* Relative time format, consisting of a relative duration format.
|
|
666
677
|
*
|
package/dist/index.js
CHANGED
|
@@ -160,15 +160,21 @@ function escapeInlineCode(text) {
|
|
|
160
160
|
__name(escapeInlineCode, "escapeInlineCode");
|
|
161
161
|
function escapeItalic(text) {
|
|
162
162
|
let idx = 0;
|
|
163
|
-
const newText = text.replaceAll(
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
163
|
+
const newText = text.replaceAll(
|
|
164
|
+
/(?<=^|[^*])(?<!(?<!<)https?:\/\/\S*|<[^\s:]+:\/[^\s>]*)\*([^*]|\*\*|$)/g,
|
|
165
|
+
(_, match) => {
|
|
166
|
+
if (match === "**") return ++idx % 2 ? `\\*${match}` : `${match}\\*`;
|
|
167
|
+
return `\\*${match}`;
|
|
168
|
+
}
|
|
169
|
+
);
|
|
167
170
|
idx = 0;
|
|
168
|
-
return newText.replaceAll(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
return newText.replaceAll(
|
|
172
|
+
/(?<=^|[^_])(?<!<a?:.+|(?<!<)https?:\/\/\S*|<[^\s:]:\/[^\s>]*)_(?!:\d+>)([^_]|__|$)/g,
|
|
173
|
+
(_, match) => {
|
|
174
|
+
if (match === "__") return ++idx % 2 ? `\\_${match}` : `${match}\\_`;
|
|
175
|
+
return `\\_${match}`;
|
|
176
|
+
}
|
|
177
|
+
);
|
|
172
178
|
}
|
|
173
179
|
__name(escapeItalic, "escapeItalic");
|
|
174
180
|
function escapeBold(text) {
|
|
@@ -389,11 +395,11 @@ var TimestampStyles = {
|
|
|
389
395
|
*/
|
|
390
396
|
ShortTime: "t",
|
|
391
397
|
/**
|
|
392
|
-
*
|
|
398
|
+
* Medium time format, consisting of hours, minutes, and seconds.
|
|
393
399
|
*
|
|
394
400
|
* @example `16:20:30`
|
|
395
401
|
*/
|
|
396
|
-
|
|
402
|
+
MediumTime: "T",
|
|
397
403
|
/**
|
|
398
404
|
* Short date format, consisting of day, month, and year.
|
|
399
405
|
*
|
|
@@ -403,21 +409,33 @@ var TimestampStyles = {
|
|
|
403
409
|
/**
|
|
404
410
|
* Long date format, consisting of day, month, and year.
|
|
405
411
|
*
|
|
406
|
-
* @example `20
|
|
412
|
+
* @example `April 20, 2021`
|
|
407
413
|
*/
|
|
408
414
|
LongDate: "D",
|
|
409
415
|
/**
|
|
410
|
-
*
|
|
416
|
+
* Long date-short time format, consisting of long date and short time.
|
|
417
|
+
*
|
|
418
|
+
* @example `April 20, 2021 at 16:20`
|
|
419
|
+
*/
|
|
420
|
+
LongDateShortTime: "f",
|
|
421
|
+
/**
|
|
422
|
+
* Full date-short time format, consisting of full date and short time.
|
|
423
|
+
*
|
|
424
|
+
* @example `Tuesday, April 20, 2021 at 16:20`
|
|
425
|
+
*/
|
|
426
|
+
FullDateShortTime: "F",
|
|
427
|
+
/**
|
|
428
|
+
* Short date, short time format, consisting of short date and short time.
|
|
411
429
|
*
|
|
412
|
-
* @example `20
|
|
430
|
+
* @example `20/04/2021, 16:20`
|
|
413
431
|
*/
|
|
414
|
-
|
|
432
|
+
ShortDateShortTime: "s",
|
|
415
433
|
/**
|
|
416
|
-
*
|
|
434
|
+
* Short date, medium time format, consisting of short date and medium time.
|
|
417
435
|
*
|
|
418
|
-
* @example `
|
|
436
|
+
* @example `20/04/2021, 16:20:30`
|
|
419
437
|
*/
|
|
420
|
-
|
|
438
|
+
ShortDateMediumTime: "S",
|
|
421
439
|
/**
|
|
422
440
|
* Relative time format, consisting of a relative duration format.
|
|
423
441
|
*
|
|
@@ -440,7 +458,7 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
|
|
|
440
458
|
})(GuildNavigationMentions || {});
|
|
441
459
|
|
|
442
460
|
// src/index.ts
|
|
443
|
-
var version = "1.0.0-
|
|
461
|
+
var version = "1.0.0-pr-11006.1765450224-e636950b2";
|
|
444
462
|
// Annotate the CommonJS export names for ESM import in node:
|
|
445
463
|
0 && (module.exports = {
|
|
446
464
|
Faces,
|
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-move-client-init.1761650119-a4c0a246f' 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 block quotes.\n\t *\n\t * @defaultValue `true`\n\t */\n\tblockQuote?: boolean;\n\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 block quotes.\n\t *\n\t * @defaultValue `true`\n\t */\n\tquote?: 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\tblockQuote = true,\n\t\tquote = 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\tblockQuote,\n\t\t\t\t\tquote,\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\tblockQuote,\n\t\t\t\t\tquote,\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\tif (quote) res = escapeQuote(res);\n\tif (blockQuote) res = escapeBlockQuote(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\n/**\n * Escapes quote characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeQuote(text: string): string {\n\treturn text.replaceAll(/^(\\s*)>(\\s+)/gm, '$1\\\\>$2');\n}\n\n/**\n * Escapes block quote characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBlockQuote(text: string): string {\n\treturn text.replaceAll(/^(\\s*)>>>(\\s+)/gm, '$1\\\\>>>$2');\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;AAAA;AAAA;;;AC4HO,SAAS,eAAe,MAAc,UAAiC,CAAC,GAAW;AACzF,QAAM;AAAA,IACL,WAAAA,aAAY;AAAA,IACZ,YAAAC,cAAa;AAAA,IACb,MAAAC,QAAO;AAAA,IACP,QA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A;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;;;AFpxBL,IAAM,UAAU;","names":["codeBlock","inlineCode","bold","italic","underline","strikethrough","spoiler","heading","blockQuote","quote","HeadingLevel","element","email","phoneNumber","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-pr-11006.1765450224-e636950b2' 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 block quotes.\n\t *\n\t * @defaultValue `true`\n\t */\n\tblockQuote?: boolean;\n\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 block quotes.\n\t *\n\t * @defaultValue `true`\n\t */\n\tquote?: 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\tblockQuote = true,\n\t\tquote = 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\tblockQuote,\n\t\t\t\t\tquote,\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\tblockQuote,\n\t\t\t\t\tquote,\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\tif (quote) res = escapeQuote(res);\n\tif (blockQuote) res = escapeBlockQuote(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(\n\t\t/(?<=^|[^*])(?<!(?<!<)https?:\\/\\/\\S*|<[^\\s:]+:\\/[^\\s>]*)\\*([^*]|\\*\\*|$)/g,\n\t\t(_, match) => {\n\t\t\tif (match === '**') return ++idx % 2 ? `\\\\*${match}` : `${match}\\\\*`;\n\t\t\treturn `\\\\*${match}`;\n\t\t},\n\t);\n\tidx = 0;\n\treturn newText.replaceAll(\n\t\t/(?<=^|[^_])(?<!<a?:.+|(?<!<)https?:\\/\\/\\S*|<[^\\s:]:\\/[^\\s>]*)_(?!:\\d+>)([^_]|__|$)/g,\n\t\t(_, match) => {\n\t\t\tif (match === '__') return ++idx % 2 ? `\\\\_${match}` : `${match}\\\\_`;\n\t\t\treturn `\\\\_${match}`;\n\t\t},\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\n/**\n * Escapes quote characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeQuote(text: string): string {\n\treturn text.replaceAll(/^(\\s*)>(\\s+)/gm, '$1\\\\>$2');\n}\n\n/**\n * Escapes block quote characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBlockQuote(text: string): string {\n\treturn text.replaceAll(/^(\\s*)>>>(\\s+)/gm, '$1\\\\>>>$2');\n}\n","import 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\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 * Medium time format, consisting of hours, minutes, and seconds.\n\t *\n\t * @example `16:20:30`\n\t */\n\tMediumTime: '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 `April 20, 2021`\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Long date-short time format, consisting of long date and short time.\n\t *\n\t * @example `April 20, 2021 at 16:20`\n\t */\n\tLongDateShortTime: 'f',\n\n\t/**\n\t * Full date-short time format, consisting of full date and short time.\n\t *\n\t * @example `Tuesday, April 20, 2021 at 16:20`\n\t */\n\tFullDateShortTime: 'F',\n\n\t/**\n\t * Short date, short time format, consisting of short date and short time.\n\t *\n\t * @example `20/04/2021, 16:20`\n\t */\n\tShortDateShortTime: 's',\n\n\t/**\n\t * Short date, medium time format, consisting of short date and medium time.\n\t *\n\t * @example `20/04/2021, 16:20:30`\n\t */\n\tShortDateMediumTime: 'S',\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;AAAA;AAAA;;;AC4HO,SAAS,eAAe,MAAc,UAAiC,CAAC,GA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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOX,UAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOV,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnB,mBAAmB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOnB,oBAAoB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOpB,qBAAqB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOrB,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;;;AFhyBL,IAAM,UAAU;","names":["codeBlock","inlineCode","bold","italic","underline","strikethrough","spoiler","heading","blockQuote","quote","HeadingLevel","element","email","phoneNumber","Faces","GuildNavigationMentions"]}
|
package/dist/index.mjs
CHANGED
|
@@ -90,15 +90,21 @@ function escapeInlineCode(text) {
|
|
|
90
90
|
__name(escapeInlineCode, "escapeInlineCode");
|
|
91
91
|
function escapeItalic(text) {
|
|
92
92
|
let idx = 0;
|
|
93
|
-
const newText = text.replaceAll(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
93
|
+
const newText = text.replaceAll(
|
|
94
|
+
/(?<=^|[^*])(?<!(?<!<)https?:\/\/\S*|<[^\s:]+:\/[^\s>]*)\*([^*]|\*\*|$)/g,
|
|
95
|
+
(_, match) => {
|
|
96
|
+
if (match === "**") return ++idx % 2 ? `\\*${match}` : `${match}\\*`;
|
|
97
|
+
return `\\*${match}`;
|
|
98
|
+
}
|
|
99
|
+
);
|
|
97
100
|
idx = 0;
|
|
98
|
-
return newText.replaceAll(
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
101
|
+
return newText.replaceAll(
|
|
102
|
+
/(?<=^|[^_])(?<!<a?:.+|(?<!<)https?:\/\/\S*|<[^\s:]:\/[^\s>]*)_(?!:\d+>)([^_]|__|$)/g,
|
|
103
|
+
(_, match) => {
|
|
104
|
+
if (match === "__") return ++idx % 2 ? `\\_${match}` : `${match}\\_`;
|
|
105
|
+
return `\\_${match}`;
|
|
106
|
+
}
|
|
107
|
+
);
|
|
102
108
|
}
|
|
103
109
|
__name(escapeItalic, "escapeItalic");
|
|
104
110
|
function escapeBold(text) {
|
|
@@ -319,11 +325,11 @@ var TimestampStyles = {
|
|
|
319
325
|
*/
|
|
320
326
|
ShortTime: "t",
|
|
321
327
|
/**
|
|
322
|
-
*
|
|
328
|
+
* Medium time format, consisting of hours, minutes, and seconds.
|
|
323
329
|
*
|
|
324
330
|
* @example `16:20:30`
|
|
325
331
|
*/
|
|
326
|
-
|
|
332
|
+
MediumTime: "T",
|
|
327
333
|
/**
|
|
328
334
|
* Short date format, consisting of day, month, and year.
|
|
329
335
|
*
|
|
@@ -333,21 +339,33 @@ var TimestampStyles = {
|
|
|
333
339
|
/**
|
|
334
340
|
* Long date format, consisting of day, month, and year.
|
|
335
341
|
*
|
|
336
|
-
* @example `20
|
|
342
|
+
* @example `April 20, 2021`
|
|
337
343
|
*/
|
|
338
344
|
LongDate: "D",
|
|
339
345
|
/**
|
|
340
|
-
*
|
|
346
|
+
* Long date-short time format, consisting of long date and short time.
|
|
347
|
+
*
|
|
348
|
+
* @example `April 20, 2021 at 16:20`
|
|
349
|
+
*/
|
|
350
|
+
LongDateShortTime: "f",
|
|
351
|
+
/**
|
|
352
|
+
* Full date-short time format, consisting of full date and short time.
|
|
353
|
+
*
|
|
354
|
+
* @example `Tuesday, April 20, 2021 at 16:20`
|
|
355
|
+
*/
|
|
356
|
+
FullDateShortTime: "F",
|
|
357
|
+
/**
|
|
358
|
+
* Short date, short time format, consisting of short date and short time.
|
|
341
359
|
*
|
|
342
|
-
* @example `20
|
|
360
|
+
* @example `20/04/2021, 16:20`
|
|
343
361
|
*/
|
|
344
|
-
|
|
362
|
+
ShortDateShortTime: "s",
|
|
345
363
|
/**
|
|
346
|
-
*
|
|
364
|
+
* Short date, medium time format, consisting of short date and medium time.
|
|
347
365
|
*
|
|
348
|
-
* @example `
|
|
366
|
+
* @example `20/04/2021, 16:20:30`
|
|
349
367
|
*/
|
|
350
|
-
|
|
368
|
+
ShortDateMediumTime: "S",
|
|
351
369
|
/**
|
|
352
370
|
* Relative time format, consisting of a relative duration format.
|
|
353
371
|
*
|
|
@@ -370,7 +388,7 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
|
|
|
370
388
|
})(GuildNavigationMentions || {});
|
|
371
389
|
|
|
372
390
|
// src/index.ts
|
|
373
|
-
var version = "1.0.0-
|
|
391
|
+
var version = "1.0.0-pr-11006.1765450224-e636950b2";
|
|
374
392
|
export {
|
|
375
393
|
Faces,
|
|
376
394
|
GuildNavigationMentions,
|
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 block quotes.\n\t *\n\t * @defaultValue `true`\n\t */\n\tblockQuote?: boolean;\n\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 block quotes.\n\t *\n\t * @defaultValue `true`\n\t */\n\tquote?: 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\tblockQuote = true,\n\t\tquote = 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\tblockQuote,\n\t\t\t\t\tquote,\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\tblockQuote,\n\t\t\t\t\tquote,\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\tif (quote) res = escapeQuote(res);\n\tif (blockQuote) res = escapeBlockQuote(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\n/**\n * Escapes quote characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeQuote(text: string): string {\n\treturn text.replaceAll(/^(\\s*)>(\\s+)/gm, '$1\\\\>$2');\n}\n\n/**\n * Escapes block quote characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBlockQuote(text: string): string {\n\treturn text.replaceAll(/^(\\s*)>>>(\\s+)/gm, '$1\\\\>>>$2');\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-move-client-init.1761650119-a4c0a246f' as string;\n"],"mappings":";;;;AA4HO,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,IACb,YAAAC,cAAa;AAAA,IACb,OAAAC,SAAQ;AAAA,EACT,IAAI;AAEJ,MAAI,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AIZ,EAAAA,yBAAA,WAAQ;AAIR,EAAAA,yBAAA,iBAAc;AAhBH,SAAAA;AAAA,GAAA;;;ACpxBL,IAAM,UAAU;","names":["codeBlock","inlineCode","bold","italic","underline","strikethrough","spoiler","heading","blockQuote","quote","HeadingLevel","element","email","phoneNumber","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 block quotes.\n\t *\n\t * @defaultValue `true`\n\t */\n\tblockQuote?: boolean;\n\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 block quotes.\n\t *\n\t * @defaultValue `true`\n\t */\n\tquote?: 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\tblockQuote = true,\n\t\tquote = 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\tblockQuote,\n\t\t\t\t\tquote,\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\tblockQuote,\n\t\t\t\t\tquote,\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\tif (quote) res = escapeQuote(res);\n\tif (blockQuote) res = escapeBlockQuote(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(\n\t\t/(?<=^|[^*])(?<!(?<!<)https?:\\/\\/\\S*|<[^\\s:]+:\\/[^\\s>]*)\\*([^*]|\\*\\*|$)/g,\n\t\t(_, match) => {\n\t\t\tif (match === '**') return ++idx % 2 ? `\\\\*${match}` : `${match}\\\\*`;\n\t\t\treturn `\\\\*${match}`;\n\t\t},\n\t);\n\tidx = 0;\n\treturn newText.replaceAll(\n\t\t/(?<=^|[^_])(?<!<a?:.+|(?<!<)https?:\\/\\/\\S*|<[^\\s:]:\\/[^\\s>]*)_(?!:\\d+>)([^_]|__|$)/g,\n\t\t(_, match) => {\n\t\t\tif (match === '__') return ++idx % 2 ? `\\\\_${match}` : `${match}\\\\_`;\n\t\t\treturn `\\\\_${match}`;\n\t\t},\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\n/**\n * Escapes quote characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeQuote(text: string): string {\n\treturn text.replaceAll(/^(\\s*)>(\\s+)/gm, '$1\\\\>$2');\n}\n\n/**\n * Escapes block quote characters in a string.\n *\n * @param text - Content to escape\n */\nexport function escapeBlockQuote(text: string): string {\n\treturn text.replaceAll(/^(\\s*)>>>(\\s+)/gm, '$1\\\\>>>$2');\n}\n","import 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\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 * Medium time format, consisting of hours, minutes, and seconds.\n\t *\n\t * @example `16:20:30`\n\t */\n\tMediumTime: '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 `April 20, 2021`\n\t */\n\tLongDate: 'D',\n\n\t/**\n\t * Long date-short time format, consisting of long date and short time.\n\t *\n\t * @example `April 20, 2021 at 16:20`\n\t */\n\tLongDateShortTime: 'f',\n\n\t/**\n\t * Full date-short time format, consisting of full date and short time.\n\t *\n\t * @example `Tuesday, April 20, 2021 at 16:20`\n\t */\n\tFullDateShortTime: 'F',\n\n\t/**\n\t * Short date, short time format, consisting of short date and short time.\n\t *\n\t * @example `20/04/2021, 16:20`\n\t */\n\tShortDateShortTime: 's',\n\n\t/**\n\t * Short date, medium time format, consisting of short date and medium time.\n\t *\n\t * @example `20/04/2021, 16:20:30`\n\t */\n\tShortDateMediumTime: 'S',\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-pr-11006.1765450224-e636950b2' as string;\n"],"mappings":";;;;AA4HO,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,IACb,YAAAC,cAAa;AAAA,IACb,OAAAC,SAAQ;AAAA,EACT,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,YAAAR;AAAA,QACA,MAAAC;AAAA,QACA,QAAAC;AAAA,QACA,WAA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AM,UAAU;","names":["codeBlock","inlineCode","bold","italic","underline","strikethrough","spoiler","heading","blockQuote","quote","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-
|
|
4
|
+
"version": "1.0.0-pr-11006.1765450224-e636950b2",
|
|
5
5
|
"description": "A set of functions to format strings for Discord.",
|
|
6
6
|
"exports": {
|
|
7
7
|
".": {
|
|
@@ -44,25 +44,25 @@
|
|
|
44
44
|
"homepage": "https://discord.js.org",
|
|
45
45
|
"funding": "https://github.com/discordjs/discord.js?sponsor",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"discord-api-types": "^0.38.
|
|
47
|
+
"discord-api-types": "^0.38.36"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@favware/cliff-jumper": "^
|
|
51
|
-
"@types/node": "^22.
|
|
52
|
-
"@vitest/coverage-v8": "^
|
|
50
|
+
"@favware/cliff-jumper": "^6.0.0",
|
|
51
|
+
"@types/node": "^22.19.1",
|
|
52
|
+
"@vitest/coverage-v8": "^4.0.15",
|
|
53
53
|
"cross-env": "^10.1.0",
|
|
54
54
|
"esbuild-plugin-version-injector": "^1.2.1",
|
|
55
|
-
"eslint": "^9.
|
|
56
|
-
"eslint-config-neon": "^0.2.
|
|
57
|
-
"eslint-formatter-compact": "^
|
|
55
|
+
"eslint": "^9.39.1",
|
|
56
|
+
"eslint-config-neon": "^0.2.9",
|
|
57
|
+
"eslint-formatter-compact": "^9.0.1",
|
|
58
58
|
"eslint-formatter-pretty": "^7.0.0",
|
|
59
|
-
"prettier": "^3.
|
|
60
|
-
"tsup": "^8.5.
|
|
61
|
-
"turbo": "^2.
|
|
59
|
+
"prettier": "^3.7.4",
|
|
60
|
+
"tsup": "^8.5.1",
|
|
61
|
+
"turbo": "^2.6.3",
|
|
62
62
|
"typescript": "~5.9.3",
|
|
63
|
-
"vitest": "^
|
|
64
|
-
"@discordjs/api-extractor": "
|
|
65
|
-
"@discordjs/scripts": "
|
|
63
|
+
"vitest": "^4.0.15",
|
|
64
|
+
"@discordjs/api-extractor": "7.52.7",
|
|
65
|
+
"@discordjs/scripts": "0.1.0"
|
|
66
66
|
},
|
|
67
67
|
"engines": {
|
|
68
68
|
"node": ">=22.12.0"
|