Skip to content

Commit

Permalink
feat: export from Formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiralite committed Jul 26, 2022
1 parent c19f6d9 commit 0b9c90a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/discord.js/src/util/Formatters.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const {
roleMention,
spoiler,
strikethrough,
channelLink,
messageLink,
time,
TimestampStyles,
underscore,
Expand Down Expand Up @@ -146,6 +148,27 @@ class Formatters extends null {
*/
static strikethrough = strikethrough;

/**
* Formats a channel link for a channel.
* @method channelLink
* @memberof Formatters
* @param {Snowflake} channelId The id of the channel
* @param {Snowflake} [guildId] The id of the guild
* @returns {string}
*/
static channelLink = channelLink;

/**
* Formats a message link for a channel.
* @method messageLink
* @memberof Formatters
* @param {Snowflake} channelId The id of the channel
* @param {Snowflake} messageId The id of the message
* @param {Snowflake} [guildId] The id of the guild
* @returns {string}
*/
static messageLink = messageLink;

/**
* Formats a date into a short date-time string.
* @method time
Expand Down
4 changes: 4 additions & 0 deletions packages/discord.js/typings/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import {
AnyComponentBuilder,
ComponentBuilder,
type RestOrArray,
channelLink,
messageLink,
} from '@discordjs/builders';
import { Collection } from '@discordjs/collection';
import { BaseImageURLOptions, ImageURLOptions, RawFile, REST, RESTOptions } from '@discordjs/rest';
Expand Down Expand Up @@ -2713,6 +2715,8 @@ export class Formatters extends null {
public static roleMention: typeof roleMention;
public static spoiler: typeof spoiler;
public static strikethrough: typeof strikethrough;
public static channelLink: typeof channelLink;
public static messageLink: typeof messageLink;
public static time: typeof time;
public static TimestampStyles: typeof TimestampStyles;
public static TimestampStylesString: TimestampStylesString;
Expand Down

0 comments on commit 0b9c90a

Please sign in to comment.