New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@sapphire/discord.js-utilities

Package Overview
Dependencies
Maintainers
3
Versions
1082
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@sapphire/discord.js-utilities - npm Package Compare versions

Comparing version 1.5.9 to 1.5.10-next.5dfb668.0

132

dist/index.js

@@ -9,3 +9,3 @@ 'use strict';

/**
* A message builder class, it implements the {@link https://discord.js.org/#/docs/main/stable/typedef/MessageOptions MessageOptions}
* A message builder class, it implements the {@linkplain https://discord.js.org/#/docs/main/stable/typedef/MessageOptions MessageOptions}
* interface.

@@ -103,3 +103,3 @@ */

/**
* Sets the value for the [[MessageBuilder.tts]] field.
* Sets the value for the {@link MessageBuilder.tts} field.
* @param tts Whether or not the message should be spoken aloud.

@@ -112,3 +112,3 @@ */

/**
* Sets the value for the [[MessageBuilder.nonce]] field.
* Sets the value for the {@link MessageBuilder.nonce} field.
* @param nonce The nonce for the message.

@@ -121,3 +121,3 @@ */

/**
* Sets the value for the [[MessageBuilder.content]] field.
* Sets the value for the {@link MessageBuilder.content} field.
* @param content The content for the message. If set to undefined and the builder is used to edit, the content will

@@ -131,3 +131,3 @@ * not be replaced.

/**
* Sets the value for the [[MessageBuilder.embed]] field.
* Sets the value for the {@link MessageBuilder.embed} field.
* @param embed An embed for the message. If set to undefined and the builder is used to edit, the embed will not be

@@ -141,3 +141,3 @@ * replaced.

/**
* Sets the value for the [[MessageBuilder.allowedMentions]] field.
* Sets the value for the {@link MessageBuilder.allowedMentions} field.
* @param allowedMentions Which mentions should be parsed from the message content.

@@ -150,4 +150,4 @@ */

/**
* Adds a new value for the [[MessageBuilder.files]] field array.
* @param file The file to add to the [[MessageBuilder.files]] field array.
* Adds a new value for the {@link MessageBuilder.files} field array.
* @param file The file to add to the {@link MessageBuilder.files} field array.
*/

@@ -160,3 +160,3 @@ addFile(file) {

/**
* Sets a single value for the [[MessageBuilder.files]] field array.
* Sets a single value for the {@link MessageBuilder.files} field array.
* @param file The file to send with the message. This should not be set when editing a message, as Discord does not

@@ -170,3 +170,3 @@ * support editing file attachments.

/**
* Sets the value for the [[MessageBuilder.files]] field.
* Sets the value for the {@link MessageBuilder.files} field.
* @param files The files to send with the message. This should not be set when editing a message, as Discord does

@@ -180,3 +180,3 @@ * not support editing file attachments.

/**
* Sets the value for the [[MessageBuilder.code]] field.
* Sets the value for the {@link MessageBuilder.code} field.
* @param code Language for optional codeblock formatting to apply.

@@ -189,3 +189,3 @@ */

/**
* Sets the value for the [[MessageBuilder.split]] field.
* Sets the value for the {@link MessageBuilder.split} field.
* @param split Whether or not the message should be split into multiple messages if it exceeds the character limit.

@@ -210,10 +210,10 @@ * If an object is provided, these are the options for splitting the message.

/**
* This is a [[PaginatedMessage]], a utility to paginate messages (usually embeds).
* This is a {@link PaginatedMessage}, a utility to paginate messages (usually embeds).
* You must either use this class directly or extend it.
*
* [[PaginatedMessage]] uses actions, these are essentially reaction emojis, when triggered run the said action.
* You can utilize your own actions, or you can use the [[PaginatedMessage.defaultActions]].
* [[PaginatedMessage.defaultActions]] is also static so you can modify these directly.
* {@link PaginatedMessage} uses actions, these are essentially reaction emojis, when triggered run the said action.
* You can utilize your own actions, or you can use the {@link PaginatedMessage.defaultActions}.
* {@link PaginatedMessage.defaultActions} is also static so you can modify these directly.
*
* [[PaginatedMessage]] also uses pages, these are simply {@link https://discord.js.org/#/docs/main/stable/class/APIMessage APIMessages}.
* {@link PaginatedMessage} also uses pages, these are simply {@linkplain https://discord.js.org/#/docs/main/stable/class/APIMessage APIMessages}.
*

@@ -228,3 +228,3 @@ * @example

* // To utilize actions you can use the IPaginatedMessageAction by implementing it into a class.
* // [[PaginatedMessage]] requires you to have the class initialized using `new`.
* // PaginatedMessage requires you to have the class initialized using `new`.
*

@@ -248,13 +248,13 @@ * class ForwardAction implements IPaginatedMessageAction {

* }
* }```
*
* }
* ```
*/
class PaginatedMessage {
/**
* Constructor for the [[PaginatedMessage]] class
* @param __namedParameters The [[PaginatedMessageOptions]] for this instance of the [[PaginatedMessage]] class
* Constructor for the {@link PaginatedMessage} class
* @param __namedParameters The {@link PaginatedMessageOptions} for this instance of the {@link PaginatedMessage} class
*/
constructor({ pages, actions } = {}) {
/**
* The pages to be converted to [[PaginatedMessage.messages]]
* The pages to be converted to {@link PaginatedMessage.messages}
*/

@@ -286,3 +286,3 @@ Object.defineProperty(this, "pages", {

/**
* The pages which were converted from [[PaginatedMessage.pages]]
* The pages which were converted from {@link PaginatedMessage.pages}
*/

@@ -405,3 +405,3 @@ Object.defineProperty(this, "messages", {

/**
* Executes the [[PaginatedMessage]] and sends the pages corresponding with [[PaginatedMessage.index]].
* Executes the {@link PaginatedMessage} and sends the pages corresponding with {@link PaginatedMessage.index}.
* The handler will start collecting reactions and running actions once all actions have been reacted to the message.

@@ -423,3 +423,3 @@ * @param author The author to validate.

/**
* Executed whenever [[PaginatedMessage.run]] is called.
* Executed whenever {@link PaginatedMessage.run} is called.
*/

@@ -587,3 +587,3 @@ async resolvePagesOnRun(channel) {

/**
* The reasons sent by {@link https://discord.js.org/#/docs/main/stable/class/ReactionCollector?scrollTo=e-end ReactionCollector#end}
* The reasons sent by {@linkplain https://discord.js.org/#/docs/main/stable/class/ReactionCollector?scrollTo=e-end ReactionCollector#end}
* event when the message (or its owner) has been deleted.

@@ -599,3 +599,3 @@ */

/**
* This is a LazyPaginatedMessage. Instead of resolving all pages that are functions on [[PaginatedMessage.run]] will resolve when requested.
* This is a LazyPaginatedMessage. Instead of resolving all pages that are functions on {@link PaginatedMessage.run} will resolve when requested.
*/

@@ -634,4 +634,4 @@ class LazyPaginatedMessage extends PaginatedMessage {

/**
* Constructor for the [[MessagePrompterBaseStrategy]] class
* @param messagePrompter The used instance of [[MessagePrompter]]
* Constructor for the {@link MessagePrompterBaseStrategy} class
* @param messagePrompter The used instance of {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -669,3 +669,3 @@ */

/**
* The message that has been sent in [[MessagePrompter.run]]
* The message that has been sent in {@link MessagePrompter.run}
*/

@@ -679,3 +679,3 @@ Object.defineProperty(this, "appliedMessage", {

/**
* The message that will be sent in [[MessagePrompter.run]]
* The message that will be sent in {@link MessagePrompter.run}
*/

@@ -756,4 +756,4 @@ Object.defineProperty(this, "message", {

/**
* Constructor for the [[MessagePrompterBaseStrategy]] class
* @param message The message to be sent [[MessagePrompter]]
* Constructor for the {@link MessagePrompterBaseStrategy} class
* @param message The message to be sent {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -786,6 +786,6 @@ */

/**
* This executes the [[MessagePrompter]] and sends the message if [[IMessagePrompterOptions.type]] equals confirm.
* This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals confirm.
* The handler will wait for one (1) reaction.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @returns A promise that resolves to a boolean denoting the value of the input (`true` for yes, `false` for no).

@@ -802,3 +802,3 @@ */

/**
* The default confirm emoji used for [[MessagePrompterConfirmStrategy]]
* The default confirm emoji used for {@link MessagePrompterConfirmStrategy}
*/

@@ -812,3 +812,3 @@ Object.defineProperty(MessagePrompterConfirmStrategy, "confirmEmoji", {

/**
* The default cancel emoji used for [[MessagePrompterConfirmStrategy]]
* The default cancel emoji used for {@link MessagePrompterConfirmStrategy}
*/

@@ -824,4 +824,4 @@ Object.defineProperty(MessagePrompterConfirmStrategy, "cancelEmoji", {

/**
* Constructor for the [[MessagePrompterBaseStrategy]] class
* @param messagePrompter The used instance of [[MessagePrompter]]
* Constructor for the {@link MessagePrompterBaseStrategy} class
* @param messagePrompter The used instance of {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -833,6 +833,6 @@ */

/**
* This executes the [[MessagePrompter]] and sends the message if [[IMessagePrompterOptions.type]] equals message.
* This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals message.
* The handler will wait for one (1) message.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @returns A promise that resolves to the message object received.

@@ -871,4 +871,4 @@ */

/**
* Constructor for the [[MessagePrompterBaseStrategy]] class
* @param messagePrompter The used instance of [[MessagePrompter]]
* Constructor for the {@link MessagePrompterBaseStrategy} class
* @param messagePrompter The used instance of {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -911,6 +911,6 @@ */

/**
* This executes the [[MessagePrompter]] and sends the message if [[IMessagePrompterOptions.type]] equals number.
* This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals number.
* The handler will wait for one (1) reaction.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @returns A promise that resolves to the selected number within the range.

@@ -945,4 +945,4 @@ */

/**
* Constructor for the [[MessagePrompterReactionStrategy]] class
* @param messagePrompter The used instance of [[MessagePrompter]]
* Constructor for the {@link MessagePrompterReactionStrategy} class
* @param messagePrompter The used instance of {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -964,6 +964,6 @@ */

/**
* This executes the [[MessagePrompterReactionStrategy]] and sends the message.
* This executes the {@link MessagePrompterReactionStrategy} and sends the message.
* The handler will wait for one (1) reaction.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @returns A promise that resolves to the reaction object.

@@ -981,3 +981,3 @@ */

/**
* This is a [[MessagePrompter]], a utility that sends a message, prompting for user input. The prompt can resolve to any kind of input.
* This is a {@link MessagePrompter}, a utility that sends a message, prompting for user input. The prompt can resolve to any kind of input.
* There are several specifiable types to prompt for user input, and they are as follows:

@@ -995,5 +995,5 @@ * - Confirm

*
* [[MessagePrompter]] uses reactions to prompt for a yes/no answer and returns it.
* You can modify the confirm and cancel reaction used for each message, or use the [[MessagePrompter.defaultPrompts]].
* [[MessagePrompter.defaultPrompts]] is also static so you can modify these directly.
* {@link MessagePrompter} uses reactions to prompt for a yes/no answer and returns it.
* You can modify the confirm and cancel reaction used for each message, or use the {@link MessagePrompter.defaultPrompts}.
* {@link MessagePrompter.defaultPrompts} is also static so you can modify these directly.
*

@@ -1031,3 +1031,3 @@ * @example

/**
* Constructor for the [[MessagePrompter]] class
* Constructor for the {@link MessagePrompter} class
* @param message The message to send.

@@ -1039,3 +1039,3 @@ * @param strategy The strategy name or Instance to use

/**
* The strategy used in [[MessagePrompter.run]]
* The strategy used in {@link MessagePrompter.run}
*/

@@ -1062,5 +1062,5 @@ Object.defineProperty(this, "strategy", {

/**
* This executes the [[MessagePrompter]] and sends the message.
* This executes the {@link MessagePrompter} and sends the message.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
*/

@@ -1096,3 +1096,3 @@ run(channel, authorOrFilter) {

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/CategoryChannel CategoryChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/CategoryChannel CategoryChannel}
* @param channel The channel to check

@@ -1104,3 +1104,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/DMChannel DMChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/DMChannel DMChannel}
* @param channel The channel to check

@@ -1112,3 +1112,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/PartialGroupDMChannel PartialGroupDMChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/PartialGroupDMChannel PartialGroupDMChannel}
* @param channel The channel to check

@@ -1120,3 +1120,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/GuildChannel GuildChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/GuildChannel GuildChannel}
* @param channel The channel to check

@@ -1128,3 +1128,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/NewsChannel NewsChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/NewsChannel NewsChannel}
* @param channel The channel to check

@@ -1136,3 +1136,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/StoreChannel StoreChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/StoreChannel StoreChannel}
* @param channel The channel to check

@@ -1144,3 +1144,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/TextChannel TextChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/TextChannel TextChannel}
* @param channel The channel to check

@@ -1152,3 +1152,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/VoiceChannel VoiceChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/VoiceChannel VoiceChannel}
* @param channel The channel to check

@@ -1155,0 +1155,0 @@ */

@@ -13,3 +13,3 @@ import type { MessageEmbed, MessageMentionOptions, MessageOptions } from 'discord.js';

/**
* A message builder class, it implements the {@link https://discord.js.org/#/docs/main/stable/typedef/MessageOptions MessageOptions}
* A message builder class, it implements the {@linkplain https://discord.js.org/#/docs/main/stable/typedef/MessageOptions MessageOptions}
* interface.

@@ -57,3 +57,3 @@ */

/**
* Sets the value for the [[MessageBuilder.tts]] field.
* Sets the value for the {@link MessageBuilder.tts} field.
* @param tts Whether or not the message should be spoken aloud.

@@ -63,3 +63,3 @@ */

/**
* Sets the value for the [[MessageBuilder.nonce]] field.
* Sets the value for the {@link MessageBuilder.nonce} field.
* @param nonce The nonce for the message.

@@ -69,3 +69,3 @@ */

/**
* Sets the value for the [[MessageBuilder.content]] field.
* Sets the value for the {@link MessageBuilder.content} field.
* @param content The content for the message. If set to undefined and the builder is used to edit, the content will

@@ -76,3 +76,3 @@ * not be replaced.

/**
* Sets the value for the [[MessageBuilder.embed]] field.
* Sets the value for the {@link MessageBuilder.embed} field.
* @param embed An embed for the message. If set to undefined and the builder is used to edit, the embed will not be

@@ -83,3 +83,3 @@ * replaced.

/**
* Sets the value for the [[MessageBuilder.allowedMentions]] field.
* Sets the value for the {@link MessageBuilder.allowedMentions} field.
* @param allowedMentions Which mentions should be parsed from the message content.

@@ -89,8 +89,8 @@ */

/**
* Adds a new value for the [[MessageBuilder.files]] field array.
* @param file The file to add to the [[MessageBuilder.files]] field array.
* Adds a new value for the {@link MessageBuilder.files} field array.
* @param file The file to add to the {@link MessageBuilder.files} field array.
*/
addFile(file: MessageBuilderFileResolvable): this;
/**
* Sets a single value for the [[MessageBuilder.files]] field array.
* Sets a single value for the {@link MessageBuilder.files} field array.
* @param file The file to send with the message. This should not be set when editing a message, as Discord does not

@@ -101,3 +101,3 @@ * support editing file attachments.

/**
* Sets the value for the [[MessageBuilder.files]] field.
* Sets the value for the {@link MessageBuilder.files} field.
* @param files The files to send with the message. This should not be set when editing a message, as Discord does

@@ -108,3 +108,3 @@ * not support editing file attachments.

/**
* Sets the value for the [[MessageBuilder.code]] field.
* Sets the value for the {@link MessageBuilder.code} field.
* @param code Language for optional codeblock formatting to apply.

@@ -114,3 +114,3 @@ */

/**
* Sets the value for the [[MessageBuilder.split]] field.
* Sets the value for the {@link MessageBuilder.split} field.
* @param split Whether or not the message should be split into multiple messages if it exceeds the character limit.

@@ -117,0 +117,0 @@ * If an object is provided, these are the options for splitting the message.

import type { APIMessage, NewsChannel, TextChannel } from 'discord.js';
import { PaginatedMessage } from './PaginatedMessage';
/**
* This is a LazyPaginatedMessage. Instead of resolving all pages that are functions on [[PaginatedMessage.run]] will resolve when requested.
* This is a LazyPaginatedMessage. Instead of resolving all pages that are functions on {@link PaginatedMessage.run} will resolve when requested.
*/

@@ -6,0 +6,0 @@ export declare class LazyPaginatedMessage extends PaginatedMessage {

@@ -5,3 +5,3 @@ import type { APIMessageContentResolvable, MessageAdditions, MessageOptions } from 'discord.js';

/**
* A type to extend multiple discord types and simplify usage in [[MessagePrompter]]
* A type to extend multiple discord types and simplify usage in {@link MessagePrompter}
*/

@@ -8,0 +8,0 @@ export declare type MessagePrompterMessage = APIMessageContentResolvable | (MessageOptions & {

@@ -23,3 +23,3 @@ import type { CollectorFilter, DMChannel, EmojiResolvable, Message, NewsChannel, TextChannel, User } from 'discord.js';

/**
* This is a [[MessagePrompter]], a utility that sends a message, prompting for user input. The prompt can resolve to any kind of input.
* This is a {@link MessagePrompter}, a utility that sends a message, prompting for user input. The prompt can resolve to any kind of input.
* There are several specifiable types to prompt for user input, and they are as follows:

@@ -37,5 +37,5 @@ * - Confirm

*
* [[MessagePrompter]] uses reactions to prompt for a yes/no answer and returns it.
* You can modify the confirm and cancel reaction used for each message, or use the [[MessagePrompter.defaultPrompts]].
* [[MessagePrompter.defaultPrompts]] is also static so you can modify these directly.
* {@link MessagePrompter} uses reactions to prompt for a yes/no answer and returns it.
* You can modify the confirm and cancel reaction used for each message, or use the {@link MessagePrompter.defaultPrompts}.
* {@link MessagePrompter.defaultPrompts} is also static so you can modify these directly.
*

@@ -73,7 +73,7 @@ * @example

/**
* The strategy used in [[MessagePrompter.run]]
* The strategy used in {@link MessagePrompter.run}
*/
strategy: MessagePrompterBaseStrategy;
/**
* Constructor for the [[MessagePrompter]] class
* Constructor for the {@link MessagePrompter} class
* @param message The message to send.

@@ -85,5 +85,5 @@ * @param strategy The strategy name or Instance to use

/**
* This executes the [[MessagePrompter]] and sends the message.
* This executes the {@link MessagePrompter} and sends the message.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
*/

@@ -90,0 +90,0 @@ run(channel: TextChannel | NewsChannel | DMChannel, authorOrFilter: User | CollectorFilter): S extends keyof StrategyReturns ? Promise<StrategyReturns[S]> : never;

@@ -19,12 +19,12 @@ import type { CollectorFilter, DMChannel, EmojiIdentifierResolvable, Message, NewsChannel, TextChannel, User } from 'discord.js';

/**
* The message that has been sent in [[MessagePrompter.run]]
* The message that has been sent in {@link MessagePrompter.run}
*/
appliedMessage: Message | null;
/**
* The message that will be sent in [[MessagePrompter.run]]
* The message that will be sent in {@link MessagePrompter.run}
*/
message: MessagePrompterMessage;
/**
* Constructor for the [[MessagePrompterBaseStrategy]] class
* @param messagePrompter The used instance of [[MessagePrompter]]
* Constructor for the {@link MessagePrompterBaseStrategy} class
* @param messagePrompter The used instance of {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -31,0 +31,0 @@ */

@@ -16,4 +16,4 @@ import type { CollectorFilter, DMChannel, EmojiResolvable, NewsChannel, TextChannel, User } from 'discord.js';

/**
* Constructor for the [[MessagePrompterBaseStrategy]] class
* @param message The message to be sent [[MessagePrompter]]
* Constructor for the {@link MessagePrompterBaseStrategy} class
* @param message The message to be sent {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -23,6 +23,6 @@ */

/**
* This executes the [[MessagePrompter]] and sends the message if [[IMessagePrompterOptions.type]] equals confirm.
* This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals confirm.
* The handler will wait for one (1) reaction.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @returns A promise that resolves to a boolean denoting the value of the input (`true` for yes, `false` for no).

@@ -32,7 +32,7 @@ */

/**
* The default confirm emoji used for [[MessagePrompterConfirmStrategy]]
* The default confirm emoji used for {@link MessagePrompterConfirmStrategy}
*/
static confirmEmoji: string | EmojiResolvable;
/**
* The default cancel emoji used for [[MessagePrompterConfirmStrategy]]
* The default cancel emoji used for {@link MessagePrompterConfirmStrategy}
*/

@@ -39,0 +39,0 @@ static cancelEmoji: string | EmojiResolvable;

@@ -8,4 +8,4 @@ import type { CollectorFilter, DMChannel, Message, NewsChannel, TextChannel, User } from 'discord.js';

/**
* Constructor for the [[MessagePrompterBaseStrategy]] class
* @param messagePrompter The used instance of [[MessagePrompter]]
* Constructor for the {@link MessagePrompterBaseStrategy} class
* @param messagePrompter The used instance of {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -15,6 +15,6 @@ */

/**
* This executes the [[MessagePrompter]] and sends the message if [[IMessagePrompterOptions.type]] equals message.
* This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals message.
* The handler will wait for one (1) message.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @returns A promise that resolves to the message object received.

@@ -21,0 +21,0 @@ */

@@ -20,4 +20,4 @@ import type { CollectorFilter, DMChannel, EmojiResolvable, NewsChannel, TextChannel, User } from 'discord.js';

/**
* Constructor for the [[MessagePrompterBaseStrategy]] class
* @param messagePrompter The used instance of [[MessagePrompter]]
* Constructor for the {@link MessagePrompterBaseStrategy} class
* @param messagePrompter The used instance of {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -27,6 +27,6 @@ */

/**
* This executes the [[MessagePrompter]] and sends the message if [[IMessagePrompterOptions.type]] equals number.
* This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals number.
* The handler will wait for one (1) reaction.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @returns A promise that resolves to the selected number within the range.

@@ -33,0 +33,0 @@ */

@@ -12,4 +12,4 @@ import type { CollectorFilter, DMChannel, EmojiResolvable, NewsChannel, TextChannel, User } from 'discord.js';

/**
* Constructor for the [[MessagePrompterReactionStrategy]] class
* @param messagePrompter The used instance of [[MessagePrompter]]
* Constructor for the {@link MessagePrompterReactionStrategy} class
* @param messagePrompter The used instance of {@link MessagePrompter}
* @param options Overrideable options if needed.

@@ -19,6 +19,6 @@ */

/**
* This executes the [[MessagePrompterReactionStrategy]] and sends the message.
* This executes the {@link MessagePrompterReactionStrategy} and sends the message.
* The handler will wait for one (1) reaction.
* @param channel The channel to use.
* @param authorOrFilter An author object to validate or a {@link https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/#/docs/main/stable/typedef/CollectorFilter CollectorFilter} predicate callback.
* @returns A promise that resolves to the reaction object.

@@ -25,0 +25,0 @@ */

import { APIMessage, Message, MessageOptions, MessageReaction, NewsChannel, ReactionCollector, TextChannel, User } from 'discord.js';
/**
* This is a [[PaginatedMessage]], a utility to paginate messages (usually embeds).
* This is a {@link PaginatedMessage}, a utility to paginate messages (usually embeds).
* You must either use this class directly or extend it.
*
* [[PaginatedMessage]] uses actions, these are essentially reaction emojis, when triggered run the said action.
* You can utilize your own actions, or you can use the [[PaginatedMessage.defaultActions]].
* [[PaginatedMessage.defaultActions]] is also static so you can modify these directly.
* {@link PaginatedMessage} uses actions, these are essentially reaction emojis, when triggered run the said action.
* You can utilize your own actions, or you can use the {@link PaginatedMessage.defaultActions}.
* {@link PaginatedMessage.defaultActions} is also static so you can modify these directly.
*
* [[PaginatedMessage]] also uses pages, these are simply {@link https://discord.js.org/#/docs/main/stable/class/APIMessage APIMessages}.
* {@link PaginatedMessage} also uses pages, these are simply {@linkplain https://discord.js.org/#/docs/main/stable/class/APIMessage APIMessages}.
*

@@ -20,3 +20,3 @@ * @example

* // To utilize actions you can use the IPaginatedMessageAction by implementing it into a class.
* // [[PaginatedMessage]] requires you to have the class initialized using `new`.
* // PaginatedMessage requires you to have the class initialized using `new`.
*

@@ -40,8 +40,8 @@ * class ForwardAction implements IPaginatedMessageAction {

* }
* }```
*
* }
* ```
*/
export declare class PaginatedMessage {
/**
* The pages to be converted to [[PaginatedMessage.messages]]
* The pages to be converted to {@link PaginatedMessage.messages}
*/

@@ -58,3 +58,3 @@ pages: MessagePage[];

/**
* The pages which were converted from [[PaginatedMessage.pages]]
* The pages which were converted from {@link PaginatedMessage.pages}
*/

@@ -75,4 +75,4 @@ messages: (APIMessage | null)[];

/**
* Constructor for the [[PaginatedMessage]] class
* @param __namedParameters The [[PaginatedMessageOptions]] for this instance of the [[PaginatedMessage]] class
* Constructor for the {@link PaginatedMessage} class
* @param __namedParameters The {@link PaginatedMessageOptions} for this instance of the {@link PaginatedMessage} class
*/

@@ -126,3 +126,3 @@ constructor({ pages, actions }?: PaginatedMessageOptions);

/**
* Executes the [[PaginatedMessage]] and sends the pages corresponding with [[PaginatedMessage.index]].
* Executes the {@link PaginatedMessage} and sends the pages corresponding with {@link PaginatedMessage.index}.
* The handler will start collecting reactions and running actions once all actions have been reacted to the message.

@@ -134,3 +134,3 @@ * @param author The author to validate.

/**
* Executed whenever [[PaginatedMessage.run]] is called.
* Executed whenever {@link PaginatedMessage.run} is called.
*/

@@ -184,3 +184,3 @@ resolvePagesOnRun(channel: TextChannel | NewsChannel): Promise<void>;

/**
* The reasons sent by {@link https://discord.js.org/#/docs/main/stable/class/ReactionCollector?scrollTo=e-end ReactionCollector#end}
* The reasons sent by {@linkplain https://discord.js.org/#/docs/main/stable/class/ReactionCollector?scrollTo=e-end ReactionCollector#end}
* event when the message (or its owner) has been deleted.

@@ -196,3 +196,3 @@ */

* ```typescript
* // To utilize actions you can use the [[IPaginatedMessageAction]] by implementing it into a class.
* // To utilize actions you can use the {@link IPaginatedMessageAction} by implementing it into a class.
*

@@ -223,3 +223,3 @@ * class ForwardAction implements IPaginatedMessageAction {

/**
* The context to be used in [[IPaginatedMessageAction]].
* The context to be used in {@link IPaginatedMessageAction}.
*/

@@ -238,10 +238,10 @@ export interface PaginatedMessageActionContext {

/**
* The pages that are used for [[PaginatedMessage.pages]]
* The pages that are used for {@link PaginatedMessage.pages}
*
* Pages can be either an {@link https://discord.js.org/#/docs/main/stable/class/APIMessage APIMessage} directly,
* or an awaited function which returns an {@link https://discord.js.org/#/docs/main/stable/class/APIMessage APIMessage}.
* Pages can be either an {@linkplain https://discord.js.org/#/docs/main/stable/class/APIMessage APIMessage} directly,
* or an awaited function which returns an {@linkplain https://discord.js.org/#/docs/main/stable/class/APIMessage APIMessage}.
*
* Furthermore, {@link https://discord.js.org/#/docs/main/stable/typedef/MessageOptions MessageOptions} can be used to
* construct the pages without state, this library also provides [[MessageBuilder]], which can be used as a chainable
* alternative to raw objects, similar to how {@link https://discord.js.org/#/docs/main/stable/class/MessageEmbed MessageEmbed}
* Furthermore, {@linkplain https://discord.js.org/#/docs/main/stable/typedef/MessageOptions MessageOptions} can be used to
* construct the pages without state, this library also provides {@link MessageBuilder}, which can be used as a chainable
* alternative to raw objects, similar to how {@linkplain https://discord.js.org/#/docs/main/stable/class/MessageEmbed MessageEmbed}
* works.

@@ -248,0 +248,0 @@ *

import type { CategoryChannel, Channel, DMChannel, GuildChannel, NewsChannel, PartialGroupDMChannel, StoreChannel, TextChannel, VoiceChannel } from 'discord.js';
/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/CategoryChannel CategoryChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/CategoryChannel CategoryChannel}
* @param channel The channel to check

@@ -8,3 +8,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/DMChannel DMChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/DMChannel DMChannel}
* @param channel The channel to check

@@ -14,3 +14,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/PartialGroupDMChannel PartialGroupDMChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/PartialGroupDMChannel PartialGroupDMChannel}
* @param channel The channel to check

@@ -20,3 +20,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/GuildChannel GuildChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/GuildChannel GuildChannel}
* @param channel The channel to check

@@ -26,3 +26,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/NewsChannel NewsChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/NewsChannel NewsChannel}
* @param channel The channel to check

@@ -32,3 +32,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/StoreChannel StoreChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/StoreChannel StoreChannel}
* @param channel The channel to check

@@ -38,3 +38,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/TextChannel TextChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/TextChannel TextChannel}
* @param channel The channel to check

@@ -44,3 +44,3 @@ */

/**
* Checks whether a given channel is a {@link https://discord.js.org/#/docs/main/stable/class/VoiceChannel VoiceChannel}
* Checks whether a given channel is a {@linkplain https://discord.js.org/#/docs/main/stable/class/VoiceChannel VoiceChannel}
* @param channel The channel to check

@@ -47,0 +47,0 @@ */

{
"name": "@sapphire/discord.js-utilities",
"version": "1.5.9",
"version": "1.5.10-next.5dfb668.0",
"description": "Discord.js specific utilities for your JavaScript/TypeScript bots",

@@ -53,5 +53,5 @@ "author": "@sapphire",

"dependencies": {
"@sapphire/discord-utilities": "^2.1.3"
"@sapphire/discord-utilities": "^2.1.4-next.5dfb668.0"
},
"gitHead": "d8e8c082847313e9cea8a1a2597b1963fa56b36b"
"gitHead": "5dfb6688d27ab361a7c31692465ed613b500cdb1"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc