Update Bot (j'ai plus le repo sur GitHub)

Qui c'est la conne qui a delete le repo sur GitHub? C'EST MOIIIII
This commit is contained in:
2026-02-09 14:36:26 +01:00
parent eab4419e12
commit ad2014b7b2
586 changed files with 58986 additions and 25205 deletions

View File

@@ -324,6 +324,13 @@ declare function channelMention<ChannelId extends Snowflake>(channelId: ChannelI
* @param roleId - The role id to format
*/
declare function roleMention<RoleId extends Snowflake>(roleId: RoleId): `<@&${RoleId}>`;
/**
* Formats a role id into a linked role mention.
*
* @typeParam RoleId - This is inferred by the supplied role id
* @param roleId - The role id to format
*/
declare function linkedRoleMention<RoleId extends Snowflake>(roleId: RoleId): `<id:linked-roles:${RoleId}>`;
/**
* Formats an application command name, subcommand group name, subcommand name, and id into an application command mention.
*
@@ -363,7 +370,7 @@ declare function chatInputApplicationCommandMention<CommandName extends string,
* @typeParam EmojiId - This is inferred by the supplied emoji id
* @param emojiId - The emoji id to format
*/
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:_:${EmojiId}>`;
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:emoji:${EmojiId}>`;
/**
* Formats an animated emoji id into a fully qualified emoji identifier.
*
@@ -371,7 +378,7 @@ declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animat
* @param emojiId - The emoji id to format
* @param animated - Whether the emoji is animated
*/
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:_:${EmojiId}>`;
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:emoji:${EmojiId}>`;
/**
* Formats an emoji id into a fully qualified emoji identifier.
*
@@ -379,7 +386,7 @@ declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animat
* @param emojiId - The emoji id to format
* @param animated - Whether the emoji is animated
*/
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: boolean): `<:_:${EmojiId}>` | `<a:_:${EmojiId}>`;
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: boolean): `<:emoji:${EmojiId}>` | `<a:emoji:${EmojiId}>`;
/**
* Formats a non-animated emoji id and name into a fully qualified emoji identifier.
*
@@ -575,6 +582,28 @@ declare function applicationDirectory<ApplicationId extends Snowflake>(applicati
* @param skuId - The SKU id
*/
declare function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(applicationId: ApplicationId, skuId: SKUId): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;
/**
* Formats an email address into an email mention.
*
* @typeParam Email - This is inferred by the supplied email address
* @param email - The email address to format
*/
declare function email<Email extends string>(email: Email): `<${Email}>`;
/**
* Formats an email address and headers into an email mention.
*
* @typeParam Email - This is inferred by the supplied email address
* @param email - The email address to format
* @param headers - Optional headers to include in the email mention
*/
declare function email<Email extends string>(email: Email, headers: Record<string, string | readonly string[]> | undefined): `<${Email}?${string}>`;
/**
* Formats a phone number into a phone number mention.
*
* @typeParam PhoneNumber - This is inferred by the supplied phone number
* @param phoneNumber - The phone number to format. Must start with a `+` sign.
*/
declare function phoneNumber<PhoneNumber extends `+${string}`>(phoneNumber: PhoneNumber): `<${PhoneNumber}>`;
/**
* The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}
* supported by Discord.
@@ -586,10 +615,17 @@ declare const TimestampStyles: {
* @example `16:20`
*/
readonly ShortTime: "t";
/**
* Medium time format, consisting of hours, minutes, and seconds.
*
* @example `16:20:30`
*/
readonly MediumTime: "T";
/**
* Long time format, consisting of hours, minutes, and seconds.
*
* @example `16:20:30`
* @deprecated Use {@link TimestampStyles.MediumTime} instead.
*/
readonly LongTime: "T";
/**
@@ -601,21 +637,47 @@ declare const TimestampStyles: {
/**
* Long date format, consisting of day, month, and year.
*
* @example `20 April 2021`
* @example `April 20, 2021`
*/
readonly LongDate: "D";
/**
* Long date-short time format, consisting of long date and short time.
*
* @example `April 20, 2021 at 16:20`
*/
readonly LongDateShortTime: "f";
/**
* Short date-time format, consisting of short date and short time formats.
*
* @example `20 April 2021 16:20`
* @deprecated Use {@link TimestampStyles.LongDateShortTime} instead.
*/
readonly ShortDateTime: "f";
/**
* Full date-short time format, consisting of full date and short time.
*
* @example `Tuesday, April 20, 2021 at 16:20`
*/
readonly FullDateShortTime: "F";
/**
* Long date-time format, consisting of long date and short time formats.
*
* @example `Tuesday, 20 April 2021 16:20`
* @deprecated Use {@link TimestampStyles.FullDateShortTime} instead.
*/
readonly LongDateTime: "F";
/**
* Short date, short time format, consisting of short date and short time.
*
* @example `20/04/2021, 16:20`
*/
readonly ShortDateShortTime: "s";
/**
* Short date, medium time format, consisting of short date and medium time.
*
* @example `20/04/2021, 16:20:30`
*/
readonly ShortDateMediumTime: "S";
/**
* Relative time format, consisting of a relative duration format.
*
@@ -659,7 +721,11 @@ declare enum GuildNavigationMentions {
/**
* {@link https://support.discord.com/hc/articles/13497665141655 | Server Guide} tab.
*/
Guide = "<id:guide>"
Guide = "<id:guide>",
/**
* {@link https://support.discord.com/hc/articles/10388356626711 | Linked Roles} tab.
*/
LinkedRoles = "<id:linked-roles>"
}
/**
@@ -670,4 +736,4 @@ declare enum GuildNavigationMentions {
*/
declare const version: string;
export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, messageLink, orderedList, quote, roleMention, spoiler, strikethrough, subtext, time, underline, underscore, unorderedList, userMention, version };
export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, email, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, linkedRoleMention, messageLink, orderedList, phoneNumber, quote, roleMention, spoiler, strikethrough, subtext, time, underline, underscore, unorderedList, userMention, version };

View File

@@ -324,6 +324,13 @@ declare function channelMention<ChannelId extends Snowflake>(channelId: ChannelI
* @param roleId - The role id to format
*/
declare function roleMention<RoleId extends Snowflake>(roleId: RoleId): `<@&${RoleId}>`;
/**
* Formats a role id into a linked role mention.
*
* @typeParam RoleId - This is inferred by the supplied role id
* @param roleId - The role id to format
*/
declare function linkedRoleMention<RoleId extends Snowflake>(roleId: RoleId): `<id:linked-roles:${RoleId}>`;
/**
* Formats an application command name, subcommand group name, subcommand name, and id into an application command mention.
*
@@ -363,7 +370,7 @@ declare function chatInputApplicationCommandMention<CommandName extends string,
* @typeParam EmojiId - This is inferred by the supplied emoji id
* @param emojiId - The emoji id to format
*/
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:_:${EmojiId}>`;
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: false): `<:emoji:${EmojiId}>`;
/**
* Formats an animated emoji id into a fully qualified emoji identifier.
*
@@ -371,7 +378,7 @@ declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animat
* @param emojiId - The emoji id to format
* @param animated - Whether the emoji is animated
*/
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:_:${EmojiId}>`;
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: true): `<a:emoji:${EmojiId}>`;
/**
* Formats an emoji id into a fully qualified emoji identifier.
*
@@ -379,7 +386,7 @@ declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animat
* @param emojiId - The emoji id to format
* @param animated - Whether the emoji is animated
*/
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: boolean): `<:_:${EmojiId}>` | `<a:_:${EmojiId}>`;
declare function formatEmoji<EmojiId extends Snowflake>(emojiId: EmojiId, animated?: boolean): `<:emoji:${EmojiId}>` | `<a:emoji:${EmojiId}>`;
/**
* Formats a non-animated emoji id and name into a fully qualified emoji identifier.
*
@@ -575,6 +582,28 @@ declare function applicationDirectory<ApplicationId extends Snowflake>(applicati
* @param skuId - The SKU id
*/
declare function applicationDirectory<ApplicationId extends Snowflake, SKUId extends Snowflake>(applicationId: ApplicationId, skuId: SKUId): `https://discord.com/application-directory/${ApplicationId}/store/${SKUId}`;
/**
* Formats an email address into an email mention.
*
* @typeParam Email - This is inferred by the supplied email address
* @param email - The email address to format
*/
declare function email<Email extends string>(email: Email): `<${Email}>`;
/**
* Formats an email address and headers into an email mention.
*
* @typeParam Email - This is inferred by the supplied email address
* @param email - The email address to format
* @param headers - Optional headers to include in the email mention
*/
declare function email<Email extends string>(email: Email, headers: Record<string, string | readonly string[]> | undefined): `<${Email}?${string}>`;
/**
* Formats a phone number into a phone number mention.
*
* @typeParam PhoneNumber - This is inferred by the supplied phone number
* @param phoneNumber - The phone number to format. Must start with a `+` sign.
*/
declare function phoneNumber<PhoneNumber extends `+${string}`>(phoneNumber: PhoneNumber): `<${PhoneNumber}>`;
/**
* The {@link https://discord.com/developers/docs/reference#message-formatting-timestamp-styles | message formatting timestamp styles}
* supported by Discord.
@@ -586,10 +615,17 @@ declare const TimestampStyles: {
* @example `16:20`
*/
readonly ShortTime: "t";
/**
* Medium time format, consisting of hours, minutes, and seconds.
*
* @example `16:20:30`
*/
readonly MediumTime: "T";
/**
* Long time format, consisting of hours, minutes, and seconds.
*
* @example `16:20:30`
* @deprecated Use {@link TimestampStyles.MediumTime} instead.
*/
readonly LongTime: "T";
/**
@@ -601,21 +637,47 @@ declare const TimestampStyles: {
/**
* Long date format, consisting of day, month, and year.
*
* @example `20 April 2021`
* @example `April 20, 2021`
*/
readonly LongDate: "D";
/**
* Long date-short time format, consisting of long date and short time.
*
* @example `April 20, 2021 at 16:20`
*/
readonly LongDateShortTime: "f";
/**
* Short date-time format, consisting of short date and short time formats.
*
* @example `20 April 2021 16:20`
* @deprecated Use {@link TimestampStyles.LongDateShortTime} instead.
*/
readonly ShortDateTime: "f";
/**
* Full date-short time format, consisting of full date and short time.
*
* @example `Tuesday, April 20, 2021 at 16:20`
*/
readonly FullDateShortTime: "F";
/**
* Long date-time format, consisting of long date and short time formats.
*
* @example `Tuesday, 20 April 2021 16:20`
* @deprecated Use {@link TimestampStyles.FullDateShortTime} instead.
*/
readonly LongDateTime: "F";
/**
* Short date, short time format, consisting of short date and short time.
*
* @example `20/04/2021, 16:20`
*/
readonly ShortDateShortTime: "s";
/**
* Short date, medium time format, consisting of short date and medium time.
*
* @example `20/04/2021, 16:20:30`
*/
readonly ShortDateMediumTime: "S";
/**
* Relative time format, consisting of a relative duration format.
*
@@ -659,7 +721,11 @@ declare enum GuildNavigationMentions {
/**
* {@link https://support.discord.com/hc/articles/13497665141655 | Server Guide} tab.
*/
Guide = "<id:guide>"
Guide = "<id:guide>",
/**
* {@link https://support.discord.com/hc/articles/10388356626711 | Linked Roles} tab.
*/
LinkedRoles = "<id:linked-roles>"
}
/**
@@ -670,4 +736,4 @@ declare enum GuildNavigationMentions {
*/
declare const version: string;
export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, messageLink, orderedList, quote, roleMention, spoiler, strikethrough, subtext, time, underline, underscore, unorderedList, userMention, version };
export { type EscapeMarkdownOptions, Faces, type FormatEmojiOptions, GuildNavigationMentions, HeadingLevel, type RecursiveArray, TimestampStyles, type TimestampStylesString, applicationDirectory, blockQuote, bold, channelLink, channelMention, chatInputApplicationCommandMention, codeBlock, email, escapeBold, escapeBulletedList, escapeCodeBlock, escapeEscape, escapeHeading, escapeInlineCode, escapeItalic, escapeMarkdown, escapeMaskedLink, escapeNumberedList, escapeSpoiler, escapeStrikethrough, escapeUnderline, formatEmoji, heading, hideLinkEmbed, hyperlink, inlineCode, italic, linkedRoleMention, messageLink, orderedList, phoneNumber, quote, roleMention, spoiler, strikethrough, subtext, time, underline, underscore, unorderedList, userMention, version };

View File

@@ -19,8 +19,8 @@ var __copyProps = (to, from, except, desc) => {
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/index.ts
var src_exports = {};
__export(src_exports, {
var index_exports = {};
__export(index_exports, {
Faces: () => Faces,
GuildNavigationMentions: () => GuildNavigationMentions,
HeadingLevel: () => HeadingLevel,
@@ -32,6 +32,7 @@ __export(src_exports, {
channelMention: () => channelMention,
chatInputApplicationCommandMention: () => chatInputApplicationCommandMention,
codeBlock: () => codeBlock,
email: () => email,
escapeBold: () => escapeBold,
escapeBulletedList: () => escapeBulletedList,
escapeCodeBlock: () => escapeCodeBlock,
@@ -51,8 +52,10 @@ __export(src_exports, {
hyperlink: () => hyperlink,
inlineCode: () => inlineCode,
italic: () => italic,
linkedRoleMention: () => linkedRoleMention,
messageLink: () => messageLink,
orderedList: () => orderedList,
phoneNumber: () => phoneNumber,
quote: () => quote,
roleMention: () => roleMention,
spoiler: () => spoiler,
@@ -65,7 +68,7 @@ __export(src_exports, {
userMention: () => userMention,
version: () => version
});
module.exports = __toCommonJS(src_exports);
module.exports = __toCommonJS(index_exports);
// src/escapers.ts
function escapeMarkdown(text, options = {}) {
@@ -148,15 +151,21 @@ function escapeInlineCode(text) {
__name(escapeInlineCode, "escapeInlineCode");
function escapeItalic(text) {
let idx = 0;
const newText = text.replaceAll(/(?<=^|[^*])\*([^*]|\*\*|$)/g, (_, match) => {
if (match === "**") return ++idx % 2 ? `\\*${match}` : `${match}\\*`;
return `\\*${match}`;
});
const newText = text.replaceAll(
/(?<=^|[^*])(?<!(?<!<)https?:\/\/\S*|<[^\s:]+:\/[^\s>]*)\*([^*]|\*\*|$)/g,
(_, match) => {
if (match === "**") return ++idx % 2 ? `\\*${match}` : `${match}\\*`;
return `\\*${match}`;
}
);
idx = 0;
return newText.replaceAll(/(?<=^|[^_])(?<!<a?:.+|https?:\/\/\S+)_(?!:\d+>)([^_]|__|$)/g, (_, match) => {
if (match === "__") return ++idx % 2 ? `\\_${match}` : `${match}\\_`;
return `\\_${match}`;
});
return newText.replaceAll(
/(?<=^|[^_])(?<!<a?:.+|(?<!<)https?:\/\/\S*|<[^\s:]:\/[^\s>]*)_(?!:\d+>)([^_]|__|$)/g,
(_, match) => {
if (match === "__") return ++idx % 2 ? `\\_${match}` : `${match}\\_`;
return `\\_${match}`;
}
);
}
__name(escapeItalic, "escapeItalic");
function escapeBold(text) {
@@ -269,6 +278,10 @@ function roleMention(roleId) {
return `<@&${roleId}>`;
}
__name(roleMention, "roleMention");
function linkedRoleMention(roleId) {
return `<id:linked-roles:${roleId}>`;
}
__name(linkedRoleMention, "linkedRoleMention");
function chatInputApplicationCommandMention(commandName, subcommandGroupName, subcommandName, commandId) {
if (commandId !== void 0) {
return `</${commandName} ${subcommandGroupName} ${subcommandName}:${commandId}>`;
@@ -285,7 +298,7 @@ function formatEmoji(emojiIdOrOptions, animated) {
animated: animated ?? false
} : emojiIdOrOptions;
const { id, animated: isAnimated, name: emojiName } = options;
return `<${isAnimated ? "a" : ""}:${emojiName ?? "_"}:${id}>`;
return `<${isAnimated ? "a" : ""}:${emojiName ?? "emoji"}:${id}>`;
}
__name(formatEmoji, "formatEmoji");
function channelLink(channelId, guildId) {
@@ -344,6 +357,23 @@ function applicationDirectory(applicationId, skuId) {
return skuId ? `${url}/${skuId}` : url;
}
__name(applicationDirectory, "applicationDirectory");
function email(email2, headers) {
if (headers) {
const searchParams = new URLSearchParams(
Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value]))
);
return `<${email2}?${searchParams.toString()}>`;
}
return `<${email2}>`;
}
__name(email, "email");
function phoneNumber(phoneNumber2) {
if (!phoneNumber2.startsWith("+")) {
throw new Error('Phone number must start with a "+" sign.');
}
return `<${phoneNumber2}>`;
}
__name(phoneNumber, "phoneNumber");
var TimestampStyles = {
/**
* Short time format, consisting of hours and minutes.
@@ -351,10 +381,17 @@ var TimestampStyles = {
* @example `16:20`
*/
ShortTime: "t",
/**
* Medium time format, consisting of hours, minutes, and seconds.
*
* @example `16:20:30`
*/
MediumTime: "T",
/**
* Long time format, consisting of hours, minutes, and seconds.
*
* @example `16:20:30`
* @deprecated Use {@link TimestampStyles.MediumTime} instead.
*/
LongTime: "T",
/**
@@ -366,21 +403,47 @@ var TimestampStyles = {
/**
* Long date format, consisting of day, month, and year.
*
* @example `20 April 2021`
* @example `April 20, 2021`
*/
LongDate: "D",
/**
* Long date-short time format, consisting of long date and short time.
*
* @example `April 20, 2021 at 16:20`
*/
LongDateShortTime: "f",
/**
* Short date-time format, consisting of short date and short time formats.
*
* @example `20 April 2021 16:20`
* @deprecated Use {@link TimestampStyles.LongDateShortTime} instead.
*/
ShortDateTime: "f",
/**
* Full date-short time format, consisting of full date and short time.
*
* @example `Tuesday, April 20, 2021 at 16:20`
*/
FullDateShortTime: "F",
/**
* Long date-time format, consisting of long date and short time formats.
*
* @example `Tuesday, 20 April 2021 16:20`
* @deprecated Use {@link TimestampStyles.FullDateShortTime} instead.
*/
LongDateTime: "F",
/**
* Short date, short time format, consisting of short date and short time.
*
* @example `20/04/2021, 16:20`
*/
ShortDateShortTime: "s",
/**
* Short date, medium time format, consisting of short date and medium time.
*
* @example `20/04/2021, 16:20:30`
*/
ShortDateMediumTime: "S",
/**
* Relative time format, consisting of a relative duration format.
*
@@ -398,11 +461,12 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
GuildNavigationMentions2["Browse"] = "<id:browse>";
GuildNavigationMentions2["Customize"] = "<id:customize>";
GuildNavigationMentions2["Guide"] = "<id:guide>";
GuildNavigationMentions2["LinkedRoles"] = "<id:linked-roles>";
return GuildNavigationMentions2;
})(GuildNavigationMentions || {});
// src/index.ts
var version = "0.6.1";
var version = "0.6.2";
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Faces,
@@ -416,6 +480,7 @@ var version = "0.6.1";
channelMention,
chatInputApplicationCommandMention,
codeBlock,
email,
escapeBold,
escapeBulletedList,
escapeCodeBlock,
@@ -435,8 +500,10 @@ var version = "0.6.1";
hyperlink,
inlineCode,
italic,
linkedRoleMention,
messageLink,
orderedList,
phoneNumber,
quote,
roleMention,
spoiler,

File diff suppressed because one or more lines are too long

View File

@@ -82,15 +82,21 @@ function escapeInlineCode(text) {
__name(escapeInlineCode, "escapeInlineCode");
function escapeItalic(text) {
let idx = 0;
const newText = text.replaceAll(/(?<=^|[^*])\*([^*]|\*\*|$)/g, (_, match) => {
if (match === "**") return ++idx % 2 ? `\\*${match}` : `${match}\\*`;
return `\\*${match}`;
});
const newText = text.replaceAll(
/(?<=^|[^*])(?<!(?<!<)https?:\/\/\S*|<[^\s:]+:\/[^\s>]*)\*([^*]|\*\*|$)/g,
(_, match) => {
if (match === "**") return ++idx % 2 ? `\\*${match}` : `${match}\\*`;
return `\\*${match}`;
}
);
idx = 0;
return newText.replaceAll(/(?<=^|[^_])(?<!<a?:.+|https?:\/\/\S+)_(?!:\d+>)([^_]|__|$)/g, (_, match) => {
if (match === "__") return ++idx % 2 ? `\\_${match}` : `${match}\\_`;
return `\\_${match}`;
});
return newText.replaceAll(
/(?<=^|[^_])(?<!<a?:.+|(?<!<)https?:\/\/\S*|<[^\s:]:\/[^\s>]*)_(?!:\d+>)([^_]|__|$)/g,
(_, match) => {
if (match === "__") return ++idx % 2 ? `\\_${match}` : `${match}\\_`;
return `\\_${match}`;
}
);
}
__name(escapeItalic, "escapeItalic");
function escapeBold(text) {
@@ -203,6 +209,10 @@ function roleMention(roleId) {
return `<@&${roleId}>`;
}
__name(roleMention, "roleMention");
function linkedRoleMention(roleId) {
return `<id:linked-roles:${roleId}>`;
}
__name(linkedRoleMention, "linkedRoleMention");
function chatInputApplicationCommandMention(commandName, subcommandGroupName, subcommandName, commandId) {
if (commandId !== void 0) {
return `</${commandName} ${subcommandGroupName} ${subcommandName}:${commandId}>`;
@@ -219,7 +229,7 @@ function formatEmoji(emojiIdOrOptions, animated) {
animated: animated ?? false
} : emojiIdOrOptions;
const { id, animated: isAnimated, name: emojiName } = options;
return `<${isAnimated ? "a" : ""}:${emojiName ?? "_"}:${id}>`;
return `<${isAnimated ? "a" : ""}:${emojiName ?? "emoji"}:${id}>`;
}
__name(formatEmoji, "formatEmoji");
function channelLink(channelId, guildId) {
@@ -278,6 +288,23 @@ function applicationDirectory(applicationId, skuId) {
return skuId ? `${url}/${skuId}` : url;
}
__name(applicationDirectory, "applicationDirectory");
function email(email2, headers) {
if (headers) {
const searchParams = new URLSearchParams(
Object.fromEntries(Object.entries(headers).map(([key, value]) => [key.toLowerCase(), value]))
);
return `<${email2}?${searchParams.toString()}>`;
}
return `<${email2}>`;
}
__name(email, "email");
function phoneNumber(phoneNumber2) {
if (!phoneNumber2.startsWith("+")) {
throw new Error('Phone number must start with a "+" sign.');
}
return `<${phoneNumber2}>`;
}
__name(phoneNumber, "phoneNumber");
var TimestampStyles = {
/**
* Short time format, consisting of hours and minutes.
@@ -285,10 +312,17 @@ var TimestampStyles = {
* @example `16:20`
*/
ShortTime: "t",
/**
* Medium time format, consisting of hours, minutes, and seconds.
*
* @example `16:20:30`
*/
MediumTime: "T",
/**
* Long time format, consisting of hours, minutes, and seconds.
*
* @example `16:20:30`
* @deprecated Use {@link TimestampStyles.MediumTime} instead.
*/
LongTime: "T",
/**
@@ -300,21 +334,47 @@ var TimestampStyles = {
/**
* Long date format, consisting of day, month, and year.
*
* @example `20 April 2021`
* @example `April 20, 2021`
*/
LongDate: "D",
/**
* Long date-short time format, consisting of long date and short time.
*
* @example `April 20, 2021 at 16:20`
*/
LongDateShortTime: "f",
/**
* Short date-time format, consisting of short date and short time formats.
*
* @example `20 April 2021 16:20`
* @deprecated Use {@link TimestampStyles.LongDateShortTime} instead.
*/
ShortDateTime: "f",
/**
* Full date-short time format, consisting of full date and short time.
*
* @example `Tuesday, April 20, 2021 at 16:20`
*/
FullDateShortTime: "F",
/**
* Long date-time format, consisting of long date and short time formats.
*
* @example `Tuesday, 20 April 2021 16:20`
* @deprecated Use {@link TimestampStyles.FullDateShortTime} instead.
*/
LongDateTime: "F",
/**
* Short date, short time format, consisting of short date and short time.
*
* @example `20/04/2021, 16:20`
*/
ShortDateShortTime: "s",
/**
* Short date, medium time format, consisting of short date and medium time.
*
* @example `20/04/2021, 16:20:30`
*/
ShortDateMediumTime: "S",
/**
* Relative time format, consisting of a relative duration format.
*
@@ -332,11 +392,12 @@ var GuildNavigationMentions = /* @__PURE__ */ ((GuildNavigationMentions2) => {
GuildNavigationMentions2["Browse"] = "<id:browse>";
GuildNavigationMentions2["Customize"] = "<id:customize>";
GuildNavigationMentions2["Guide"] = "<id:guide>";
GuildNavigationMentions2["LinkedRoles"] = "<id:linked-roles>";
return GuildNavigationMentions2;
})(GuildNavigationMentions || {});
// src/index.ts
var version = "0.6.1";
var version = "0.6.2";
export {
Faces,
GuildNavigationMentions,
@@ -349,6 +410,7 @@ export {
channelMention,
chatInputApplicationCommandMention,
codeBlock,
email,
escapeBold,
escapeBulletedList,
escapeCodeBlock,
@@ -368,8 +430,10 @@ export {
hyperlink,
inlineCode,
italic,
linkedRoleMention,
messageLink,
orderedList,
phoneNumber,
quote,
roleMention,
spoiler,

File diff suppressed because one or more lines are too long