"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Faces = exports.TimestampStyles = exports.time = exports.formatEmoji = exports.roleMention = exports.channelMention = exports.memberNicknameMention = exports.userMention = exports.spoiler = exports.hyperlink = exports.hideLinkEmbed = exports.blockQuote = exports.quote = exports.strikethrough = exports.underscore = exports.bold = exports.italic = exports.inlineCode = exports.codeBlock = void 0;
function codeBlock(language, content) {
    return typeof content === 'undefined' ? `\`\`\`\n${language}\`\`\`` : `\`\`\`${language}\n${content}\`\`\``;
}
exports.codeBlock = codeBlock;
/**
 * Wraps the content inside \`backticks\`, which formats it as inline code.
 * @param content The content to wrap.
 */
function inlineCode(content) {
    return `\`${content}\``;
}
exports.inlineCode = inlineCode;
/**
 * Formats the content into italic text.
 * @param content The content to wrap.
 */
function italic(content) {
    return `_${content}_`;
}
exports.italic = italic;
/**
 * Formats the content into bold text.
 * @param content The content to wrap.
 */
function bold(content) {
    return `**${content}**`;
}
exports.bold = bold;
/**
 * Formats the content into underscored text.
 * @param content The content to wrap.
 */
function underscore(content) {
    return `__${content}__`;
}
exports.underscore = underscore;
/**
 * Formats the content into strike-through text.
 * @param content The content to wrap.
 */
function strikethrough(content) {
    return `~~${content}~~`;
}
exports.strikethrough = strikethrough;
/**
 * Formats the content into a quote. This needs to be at the start of the line for Discord to format it.
 * @param content The content to wrap.
 */
function quote(content) {
    return `> ${content}`;
}
exports.quote = quote;
/**
 * Formats the content into a block quote. This needs to be at the start of the line for Discord to format it.
 * @param content The content to wrap.
 */
function blockQuote(content) {
    return `>>> ${content}`;
}
exports.blockQuote = blockQuote;
function hideLinkEmbed(url) {
    // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
    return `<${url}>`;
}
exports.hideLinkEmbed = hideLinkEmbed;
function hyperlink(content, url, title) {
    // eslint-disable-next-line @typescript-eslint/restrict-template-expressions
    return title ? `[${content}](${url} "${title}")` : `[${content}](${url})`;
}
exports.hyperlink = hyperlink;
/**
 * Wraps the content inside spoiler (hidden text).
 * @param content The content to wrap.
 */
function spoiler(content) {
    return `||${content}||`;
}
exports.spoiler = spoiler;
/**
 * Formats a user ID into a user mention.
 * @param userId The user ID to format.
 */
function userMention(userId) {
    return `<@${userId}>`;
}
exports.userMention = userMention;
/**
 * Formats a user ID into a member-nickname mention.
 * @param memberId The user ID to format.
 */
function memberNicknameMention(memberId) {
    return `<@!${memberId}>`;
}
exports.memberNicknameMention = memberNicknameMention;
/**
 * Formats a channel ID into a channel mention.
 * @param channelId The channel ID to format.
 */
function channelMention(channelId) {
    return `<#${channelId}>`;
}
exports.channelMention = channelMention;
/**
 * Formats a role ID into a role mention.
 * @param roleId The role ID to format.
 */
function roleMention(roleId) {
    return `<@&${roleId}>`;
}
exports.roleMention = roleMention;
/**
 * Formats an emoji ID into a fully qualified emoji identifier
 * @param emojiId The emoji ID to format.
 * @param animated Whether the emoji is animated or not. Defaults to `false`
 */
function formatEmoji(emojiId, animated = false) {
    return `<${animated ? 'a' : ''}:_:${emojiId}>`;
}
exports.formatEmoji = formatEmoji;
function time(timeOrSeconds, style) {
    if (typeof timeOrSeconds !== 'number') {
        timeOrSeconds = Math.floor((timeOrSeconds?.getTime() ?? Date.now()) / 1000);
    }
    return typeof style === 'string' ? `<t:${timeOrSeconds}:${style}>` : `<t:${timeOrSeconds}>`;
}
exports.time = time;
/**
 * The [message formatting timestamp styles](https://discord.com/developers/docs/reference#message-formatting-timestamp-styles) supported by Discord.
 */
exports.TimestampStyles = {
    /**
     * Short time format, consisting of hours and minutes, e.g. 16:20.
     */
    ShortTime: 't',
    /**
     * Long time format, consisting of hours, minutes, and seconds, e.g. 16:20:30.
     */
    LongTime: 'T',
    /**
     * Short date format, consisting of day, month, and year, e.g. 20/04/2021.
     */
    ShortDate: 'd',
    /**
     * Long date format, consisting of day, month, and year, e.g. 20 April 2021.
     */
    LongDate: 'D',
    /**
     * Short date-time format, consisting of short date and short time formats, e.g. 20 April 2021 16:20.
     */
    ShortDateTime: 'f',
    /**
     * Long date-time format, consisting of long date and short time formats, e.g. Tuesday, 20 April 2021 16:20.
     */
    LongDateTime: 'F',
    /**
     * Relative time format, consisting of a relative duration format, e.g. 2 months ago.
     */
    RelativeTime: 'R',
};
/**
 * An enum with all the available faces from Discord's native slash commands
 */
var Faces;
(function (Faces) {
    /**
     * ¯\\_(ツ)\\_/¯
     */
    Faces["Shrug"] = "\u00AF\\_(\u30C4)\\_/\u00AF";
    /**
     * (╯°□°）╯︵ ┻━┻
     */
    Faces["Tableflip"] = "(\u256F\u00B0\u25A1\u00B0\uFF09\u256F\uFE35 \u253B\u2501\u253B";
    /**
     * ┬─┬ ノ( ゜-゜ノ)
     */
    Faces["Unflip"] = "\u252C\u2500\u252C \u30CE( \u309C-\u309C\u30CE)";
})(Faces = exports.Faces || (exports.Faces = {}));
//# sourceMappingURL=formatters.js.map