@sapphire/discord.js-utilities 7.3.4-next.da56be56 → 7.3.4-next.fb147ec0

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.
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/lib/builders/MessageBuilder.ts","../../src/lib/type-guards.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterConfirmStrategy.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterMessageStrategy.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterNumberStrategy.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterReactionStrategy.ts","../../src/lib/MessagePrompter/MessagePrompter.ts","../../src/lib/PaginatedMessages/utils.ts","../../src/lib/PaginatedMessages/PaginatedMessage.ts","../../src/lib/PaginatedMessages/LazyPaginatedMessage.ts","../../src/lib/PaginatedMessages/PaginatedFieldMessageEmbed.ts","../../src/lib/PaginatedMessages/PaginatedMessageEmbedFields.ts","../../src/lib/utilities.ts"],"names":["ChannelType","isNullish","Message","BaseInteraction","GuildMember","isNullishOrEmpty","isNullishOrZero","collected","reaction","ComponentType","ButtonStyle","partition","chunk","ActionRowBuilder","Time","isJSONEncodable","isFunction","EmbedBuilder","Partials","IntentsBitField","GatewayIntentBits","MessageFlags","InteractionCollector","InteractionType","deepClone","ButtonBuilder","UserSelectMenuBuilder","RoleSelectMenuBuilder","MentionableSelectMenuBuilder","ChannelSelectMenuBuilder","StringSelectMenuBuilder","isObject","userMention","EmbedLimits","PermissionsBitField","PermissionFlagsBits"],"mappings":";;;;;;;;;;;;;;;;;;;AAWO,IAAM,eAAA,GAAN,MAAM,eAA+C,CAAA;AAAA,EAyCpD,YAAY,OAAoC,EAAA;AApCvD;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IAAA,EAAA,KAAA,CAAA;AAMP;AAAA;AAAA;AAAA;AAAA,IAAO,aAAA,CAAA,IA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Ae,EAAE,CAAA;AAChD,EAAI,IAAA,CAAC,gBAAuB,OAAA,KAAA;AAE5B,EAAO,OAAA,cAAA,CAAe,IAAI,iBAAiB,CAAA;AAC5C;AAZS,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA","file":"index.cjs","sourcesContent":["import type { MessageCreateOptions } from 'discord.js';\n\nexport type MessageBuilderFileResolvable = NonNullable<MessageCreateOptions['files']>[number];\nexport type MessageBuilderResolvable = Omit<MessageCreateOptions, 'embed' | 'disableMentions' | 'reply'> & {\n\tembeds?: MessageCreateOptions['embeds'];\n\tcomponents?: MessageCreateOptions['components'];\n};\n\n/**\n * A message builder class, it implements the {@link MessageCreateOptions} interface.\n */\nexport class MessageBuilder implements MessageCreateOptions {\n\t/**\n\t * Whether or not the message should be spoken aloud.\n\t * @default false\n\t */\n\tpublic tts?: MessageCreateOptions['tts'];\n\n\t/**\n\t * The nonce for the message.\n\t * @default ''\n\t */\n\tpublic nonce?: MessageCreateOptions['nonce'];\n\n\t/**\n\t * The content for the message. If set to undefined and the builder is used to edit, the content will not be\n\t * replaced.\n\t */\n\tpublic content?: MessageCreateOptions['content'];\n\n\t/**\n\t * The embeds for the message. If set to undefined and the builder is used to edit, the embed will not be replaced.\n\t * @remark There is a maximum of 10 embeds in 1 message\n\t */\n\tpublic embeds?: MessageCreateOptions['embeds'];\n\n\t/**\n\t * The components for the message. If set to undefined and the builder is used to edit, the components will not be replaced.\n\t */\n\tpublic components?: MessageCreateOptions['components'];\n\n\t/**\n\t * Which mentions should be parsed from the message content.\n\t */\n\tpublic allowedMentions?: MessageCreateOptions['allowedMentions'];\n\n\t/**\n\t * Files to send with the message. This should not be set when editing a message, as Discord does not support\n\t * editing file attachments.\n\t */\n\tpublic files?: MessageCreateOptions['files'];\n\n\tpublic constructor(options?: MessageBuilderResolvable) {\n\t\tthis.tts = options?.tts ?? MessageBuilder.defaults.tts;\n\t\tthis.nonce = options?.nonce ?? MessageBuilder.defaults.nonce;\n\t\tthis.content = options?.content ?? MessageBuilder.defaults.content;\n\t\tthis.embeds = options?.embeds ?? MessageBuilder.defaults.embeds;\n\t\tthis.components = options?.components ?? MessageBuilder.defaults.components;\n\t\tthis.allowedMentions = options?.allowedMentions ?? MessageBuilder.defaults.allowedMentions;\n\t\tthis.files = options?.files ?? MessageBuilder.defaults.files;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.tts} field.\n\t * @param tts Whether or not the message should be spoken aloud.\n\t */\n\tpublic setTTS(tts?: boolean): this {\n\t\tthis.tts = tts;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.nonce} field.\n\t * @param nonce The nonce for the message.\n\t */\n\tpublic setNonce(nonce?: string): this {\n\t\tthis.nonce = nonce;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.content} field.\n\t * @param content The content for the message. If set to undefined and the builder is used to edit, the content will\n\t * not be replaced.\n\t */\n\tpublic setContent(content?: string): this {\n\t\tthis.content = content;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.embed} field.\n\t * @param embeds The embeds for the message. If set to undefined and the builder is used to edit, the embed will not be\n\t * replaced. There is a maximum of 10 embeds per message\n\t * @remark When providing more than 10 embeds, the array will automatically be sliced down to the first 10.\n\t */\n\tpublic setEmbeds(embeds?: MessageCreateOptions['embeds']): this {\n\t\t// Ensure no more than 10 embeds are ever set\n\t\tif (embeds && embeds.length > 10) {\n\t\t\tembeds = embeds.slice(0, 10);\n\t\t}\n\n\t\tthis.embeds = embeds;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.components} field.\n\t * @param components The components for the message. If set to undefined and the builder is used to edit, the components will\n\t * not be replaced.\n\t */\n\tpublic setComponents(components?: MessageCreateOptions['components']): this {\n\t\tthis.components = components;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.allowedMentions} field.\n\t * @param allowedMentions Which mentions should be parsed from the message content.\n\t */\n\tpublic setAllowedMentions(allowedMentions?: MessageCreateOptions['allowedMentions']): this {\n\t\tthis.allowedMentions = allowedMentions;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new value for the {@link MessageBuilder.files} field array.\n\t * @param file The file to add to the {@link MessageBuilder.files} field array.\n\t */\n\tpublic addFile(file: MessageBuilderFileResolvable): this {\n\t\tthis.files = this.files?.concat(file) ?? [file];\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets a single value for the {@link MessageBuilder.files} field array.\n\t * @param file The file to send with the message. This should not be set when editing a message, as Discord does not\n\t * support editing file attachments.\n\t */\n\tpublic setFile(file: MessageBuilderFileResolvable): this {\n\t\tthis.files = [file];\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.files} field.\n\t * @param files The files to send with the message. This should not be set when editing a message, as Discord does\n\t * not support editing file attachments.\n\t */\n\tpublic setFiles(files?: MessageBuilderFileResolvable[]): this {\n\t\tthis.files = files;\n\t\treturn this;\n\t}\n\n\t/**\n\t * The default values for all MessageBuilder instances.\n\t */\n\tpublic static defaults: MessageBuilderResolvable = {};\n}\n","import { isNullish, isNullishOrEmpty, isNullishOrZero, type Nullish } from '@sapphire/utilities';\nimport {\n\tBaseInteraction,\n\tChannelType,\n\tGuildMember,\n\tMessage,\n\ttype APIGuildMember,\n\ttype APIInteractionDataResolvedGuildMember,\n\ttype APIInteractionGuildMember,\n\ttype APIMessage,\n\ttype Attachment,\n\ttype CategoryChannel,\n\ttype Channel,\n\ttype DMChannel,\n\ttype Interaction,\n\ttype NewsChannel,\n\ttype PartialDMChannel,\n\ttype PartialGroupDMChannel,\n\ttype PrivateThreadChannel,\n\ttype PublicThreadChannel,\n\ttype StageChannel,\n\ttype TextChannel,\n\ttype ThreadChannel,\n\ttype VoiceBasedChannel,\n\ttype VoiceChannel\n} from 'discord.js';\nimport type {\n\tAnyInteractableInteraction,\n\tChannelTypes,\n\tGuildTextBasedChannelTypes,\n\tNonThreadGuildTextBasedChannelTypes,\n\tTextBasedChannelTypes\n} from './utility-types';\n\n/**\n * Checks whether a given channel is a {@link CategoryChannel}\n * This checks for {@link ChannelType.GuildCategory}.\n * @param channel The channel to check\n */\nexport function isCategoryChannel(channel: ChannelTypes | Nullish): channel is CategoryChannel {\n\treturn channel?.type === ChannelType.GuildCategory;\n}\n\n/**\n * Checks whether a given channel is a {@link DMChannel}\n * This checks for {@link ChannelType.DM}.\n * @param channel The channel to check\n */\nexport function isDMChannel(channel: ChannelTypes | Nullish): channel is DMChannel | PartialDMChannel {\n\treturn channel?.type === ChannelType.DM;\n}\n\n/**\n * Checks whether a given channel is a {@link PartialGroupDMChannel}\n * This checks for {@link ChannelType.GroupDM}.\n * @param channel The channel to check\n */\nexport function isGroupChannel(channel: Channel | PartialDMChannel | Nullish): channel is PartialGroupDMChannel {\n\treturn channel?.type === ChannelType.GroupDM;\n}\n\n/**\n * Checks if a channel comes from a guild.\n * This checks that the channel is **not** {@link ChannelType.DM}.\n * @param channel The channel to check\n * @returns Whether or not the channel is guild-based.\n */\nexport function isGuildBasedChannel(channel: ChannelTypes | Nullish): channel is GuildTextBasedChannelTypes {\n\treturn channel?.type !== ChannelType.DM;\n}\n\n/**\n * Checks whether or not a channel comes from a guild.\n * @remark As opposed to {@link isGuildBasedChannel} this checks if there is `guild` property on the channel.\n * @param channel The channel to check.\n * @returns Whether or not the channel is guild-based.\n */\nexport function isGuildBasedChannelByGuildKey(channel: ChannelTypes | Nullish): channel is GuildTextBasedChannelTypes {\n\treturn Reflect.has(channel ?? {}, 'guild');\n}\n\n/**\n * Checks whether a given channel is a {@link NewsChannel}.\n * This checks for {@link ChannelType.GuildAnnouncement}.\n * @param channel The channel to check.\n */\nexport function isNewsChannel(channel: ChannelTypes | Nullish): channel is NewsChannel {\n\treturn channel?.type === ChannelType.GuildAnnouncement;\n}\n\n/**\n * Checks whether a given channel is a {@link TextChannel}.\n * This checks for {@link ChannelType.GuildText}.\n * @param channel The channel to check.\n */\nexport function isTextChannel(channel: ChannelTypes | Nullish): channel is TextChannel {\n\treturn channel?.type === ChannelType.GuildText;\n}\n\n/**\n * Checks whether a given channel is a {@link VoiceChannel}\n * This checks for {@link ChannelType.GuildVoice}.\n * @param channel The channel to check\n */\nexport function isVoiceChannel(channel: ChannelTypes | Nullish): channel is VoiceChannel {\n\treturn channel?.type === ChannelType.GuildVoice;\n}\n\n/**\n * Checks whether a given channel is a {@link StageChannel}\n * This checks for {@link ChannelType.GuildStageVoice}.\n * @param channel The channel to check\n */\nexport function isStageChannel(channel: ChannelTypes | Nullish): channel is StageChannel {\n\treturn channel?.type === ChannelType.GuildStageVoice;\n}\n\n/**\n * Checks whether a given channel is a {@link ThreadChannel}\n * This checks for {@link ChannelTypes.isThread()}.\n * @param channel The channel to check.\n */\nexport function isThreadChannel(channel: ChannelTypes | Nullish): channel is ThreadChannel {\n\treturn channel?.isThread() ?? false;\n}\n\n/**\n * Checks whether a given channel is an Announcement {@link PublicThreadChannel}\n * This checks for {@link ChannelType.AnnouncementThread}.\n * @param channel The channel to check.\n */\nexport function isNewsThreadChannel(channel: ChannelTypes | Nullish): channel is PublicThreadChannel {\n\treturn channel?.type === ChannelType.AnnouncementThread;\n}\n\n/**\n * Checks whether a given channel is a {@link PublicThreadChannel}\n * This checks for {@link ChannelType.PublicThread}.\n * @param channel The channel to check.\n */\nexport function isPublicThreadChannel(channel: ChannelTypes | Nullish): channel is PublicThreadChannel {\n\treturn channel?.type === ChannelType.PublicThread;\n}\n\n/**\n * Checks whether a given channel is a {@link PrivateThreadChannel}\n * This checks for {@link ChannelType.PrivateThread}.\n * @param channel The channel to check.\n */\nexport function isPrivateThreadChannel(channel: ChannelTypes | Nullish): channel is PrivateThreadChannel {\n\treturn channel?.type === ChannelType.PrivateThread;\n}\n\n/**\n * Checks whether a given channel is a {@link TextBasedChannelTypes}. This means it has a `send` method.\n * @param channel The channel to check.\n */\nexport function isTextBasedChannel(channel: ChannelTypes | Nullish): channel is Exclude<TextBasedChannelTypes, StageChannel | PartialGroupDMChannel> {\n\tif (\n\t\tisNullish(channel) || //\n\t\tchannel.partial ||\n\t\tisGroupChannel(channel as Channel | PartialDMChannel | Nullish) ||\n\t\tisStageChannel(channel)\n\t) {\n\t\treturn false;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/unbound-method\n\treturn !isNullish((channel as Exclude<TextBasedChannelTypes, StageChannel | PartialGroupDMChannel>).send);\n}\n\n/**\n * Checks whether a given channel is a {@link VoiceBasedChannel}.\n * This checks for {@link Channel.isVoiceBased()}.\n * @param channel - The channel to check.\n */\nexport function isVoiceBasedChannel(channel: Channel | Nullish): channel is VoiceBasedChannel {\n\tif (isNullish(channel)) return false;\n\n\treturn channel.isVoiceBased();\n}\n\n/**\n * Checks whether a given channel allows NSFW content or not\n *\n * For the following channel types this is always false:\n * - {@link ChannelType.DM}\n * - {@link ChannelType.GroupDM}\n * - {@link ChannelType.GuildCategory}\n * - {@link ChannelType.GuildStageVoice}\n * - {@link ChannelType.GuildVoice}\n * - {@link ChannelType.GuildDirectory}\n *\n * For the following channel types the actual channel is checked:\n * - {@link ChannelType.GuildAnnouncement}\n * - {@link ChannelType.GuildText}\n * - {@link ChannelType.GuildForum}\n *\n * For the following channel types the parent of the channel is checked:\n * - {@link ChannelType.AnnouncementThread}\n * - {@link ChannelType.PrivateThread}\n * - {@link ChannelType.PublicThread}\n * - {@link ChannelType.MediaChannel}\n * @param channel The channel to check.\n */\nexport function isNsfwChannel(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\n\tswitch (channel.type) {\n\t\tcase ChannelType.DM:\n\t\tcase ChannelType.GroupDM:\n\t\tcase ChannelType.GuildCategory:\n\t\tcase ChannelType.GuildStageVoice:\n\t\tcase ChannelType.GuildVoice:\n\t\tcase ChannelType.GuildDirectory:\n\t\t\treturn false;\n\t\tcase ChannelType.GuildAnnouncement:\n\t\tcase ChannelType.GuildText:\n\t\tcase ChannelType.GuildForum:\n\t\tcase ChannelType.GuildMedia:\n\t\t\treturn (channel as Exclude<NonThreadGuildTextBasedChannelTypes, VoiceChannel | StageChannel>).nsfw;\n\t\tcase ChannelType.AnnouncementThread:\n\t\tcase ChannelType.PrivateThread:\n\t\tcase ChannelType.PublicThread:\n\t\t\treturn Boolean((channel as ThreadChannel).parent?.nsfw);\n\t}\n}\n\n/**\n * Checks whether a given message is an instance of {@link Message}, and not {@link APIMessage}\n * @param message The message to check\n * @returns `true` if the message is an instance of `Message`, false otherwise.\n */\nexport function isMessageInstance(message: APIMessage | Message): message is Message {\n\treturn message instanceof Message;\n}\n\n/**\n * Checks whether the input `messageOrInteraction` is one of {@link Message} or any class that\n * extends {@link BaseInteraction}. This generally boils down to being one of:\n * - {@link Interaction}\n * - {@link AutocompleteInteraction}\n * - {@link ButtonInteraction}\n * - {@link ChannelSelectMenuInteraction}\n * - {@link ChatInputCommandInteraction}\n * - {@link CommandInteraction}\n * - {@link ContextMenuInteraction}\n * - {@link MentionableSelectMenuInteraction}\n * - {@link MessageComponentInteraction}\n * - {@link MessageContextMenuCommandInteraction}\n * - {@link ModalSubmitInteraction}\n * - {@link RoleSelectMenuInteraction}\n * - {@link SelectMenuInteraction}\n * - {@link StringSelectMenuInteraction}\n * - {@link UserContextMenuCommandInteraction}\n * - {@link UserSelectMenuInteraction}\n *\n * @param messageOrInteraction The message or interaction that should be checked.\n * @returns `true` if the `messageOrInteraction` is an instanceof {@link BaseInteraction}, `false` if it is not.\n */\nexport function isAnyInteraction(messageOrInteraction: APIMessage | Message | BaseInteraction): messageOrInteraction is BaseInteraction {\n\treturn messageOrInteraction instanceof BaseInteraction;\n}\n\n/**\n * Checks whether the input `messageOrInteraction` is one of {@link Message} or any class that extends {@link BaseInteraction}\n * As opposed to {@link isAnyInteraction} this also checks that the interaction can actually be interacted with by the user\n * which means that this **cannot** be an {@link AutocompleteInteraction}.\n * That said, this type guard filters the `messageOrInteraction` down to one of:\n * - {@link Interaction}\n * - {@link ButtonInteraction}\n * - {@link ChannelSelectMenuInteraction}\n * - {@link ChatInputCommandInteraction}\n * - {@link CommandInteraction}\n * - {@link ContextMenuInteraction}\n * - {@link MentionableSelectMenuInteraction}\n * - {@link MessageComponentInteraction}\n * - {@link MessageContextMenuCommandInteraction}\n * - {@link ModalSubmitInteraction}\n * - {@link RoleSelectMenuInteraction}\n * - {@link SelectMenuInteraction}\n * - {@link StringSelectMenuInteraction}\n * - {@link UserContextMenuCommandInteraction}\n * - {@link UserSelectMenuInteraction}\n *\n * @param messageOrInteraction The message or interaction that should be checked.\n * @returns `true` if the `messageOrInteraction` is an instanceof {@link BaseInteraction} and does **NOT** pass\n * {@link Interaction.isAutocomplete()}, `false` otherwise.\n */\nexport function isAnyInteractableInteraction(\n\tmessageOrInteraction: APIMessage | Message | BaseInteraction\n): messageOrInteraction is AnyInteractableInteraction {\n\tif (isAnyInteraction(messageOrInteraction)) {\n\t\treturn !messageOrInteraction.isAutocomplete();\n\t}\n\n\treturn false;\n}\n\n/**\n * Checks whether a given member is an instance of {@link GuildMember}, and not {@link APIInteractionGuildMember}, {@link APIGuildMember}, or {@link Nullish}\n * @param member The member to check\n * @returns `true` if the member is an instance of `GuildMember`, false otherwise.\n */\nexport function isGuildMember(\n\tmember: GuildMember | APIGuildMember | APIInteractionGuildMember | APIInteractionDataResolvedGuildMember | Nullish\n): member is GuildMember {\n\treturn member instanceof GuildMember;\n}\n\n/**\n * Checks whether an attachment is a media attachment, this is done so by checking the content type of the attachment,\n * if the content type starts with `image/`, `video/` or `audio/` it is considered a media attachment.\n *\n * If the content type is `image/` or `video/`, it will also check if the attachment has dimensions defined to ensure\n * it is a valid media attachment.\n *\n * @param attachment - The attachment to check\n * @returns Whether the attachment is a media attachment\n *\n * @since 7.3.0\n */\nexport function isMediaAttachment(attachment: Attachment): boolean {\n\tif (isNullishOrEmpty(attachment.contentType)) return false;\n\n\t// If the attachment is an audio attachment, return true:\n\tif (attachment.contentType.startsWith('audio/')) return true;\n\n\t// If the attachment is an image or video attachment, return true if it has dimensions defined:\n\treturn attachment.contentType.startsWith('image/') || attachment.contentType.startsWith('video/') //\n\t\t? hasDimensionsDefined(attachment)\n\t\t: false;\n}\n\n/**\n * Checks whether an attachment is an image attachment, this is done so by checking the content type of the attachment,\n * if the content type starts with `image/` and the attachment has dimensions defined, it is considered an image\n * attachment.\n *\n * @param attachment - The attachment to check\n * @returns Whether the attachment is an image attachment\n *\n * @since 7.3.0\n */\nexport function isImageAttachment(attachment: Attachment): boolean {\n\treturn (\n\t\t// A content type is required for an image attachment:\n\t\t!isNullishOrEmpty(attachment.contentType) && //\n\t\t// An image attachment must have a content type starting with 'image/':\n\t\tattachment.contentType.startsWith('image/') &&\n\t\t// An image attachment must have dimensions defined:\n\t\thasDimensionsDefined(attachment)\n\t);\n}\n\n/** @internal - function used by {@link isImageAttachment} and {@link isMediaAttachment} */\nfunction hasDimensionsDefined(attachment: Attachment): boolean {\n\treturn !isNullishOrZero(attachment.width) && !isNullishOrZero(attachment.height);\n}\n","import { isNullish, type ArgumentTypes, type Awaitable } from '@sapphire/utilities';\nimport type { CollectorFilter, CollectorOptions, EmojiIdentifierResolvable, Message, MessageReaction, User } from 'discord.js';\nimport { isStageChannel, isTextBasedChannel } from '../../type-guards';\nimport type { IMessagePrompterExplicitReturnBase } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterStrategyOptions } from '../strategyOptions';\n\nexport abstract class MessagePrompterBaseStrategy {\n\t/**\n\t * The type of strategy that was used\n\t */\n\tpublic type: string;\n\n\t/**\n\t * The timeout that was used in the collector\n\t */\n\tpublic timeout: number;\n\n\t/**\n\t * Whether to return an explicit object with data, or the strategies' default\n\t */\n\tpublic explicitReturn: boolean;\n\n\t/**\n\t * The message that has been sent in {@link MessagePrompter.run}\n\t */\n\tpublic appliedMessage: Message | null = null;\n\n\t/**\n\t * The message that will be sent in {@link MessagePrompter.run}\n\t */\n\tpublic message: MessagePrompterMessage;\n\n\t/**\n\t * The message the bot will edit to send its prompt in {@link MessagePrompter.run}\n\t */\n\tpublic editMessage: Message | undefined;\n\n\t/**\n\t * Constructor for the {@link MessagePrompterBaseStrategy} class\n\t * @param type - The type of message prompter strategy\n\t * @param message - The message that this prompt is for\n\t * @param options - Overrideable options if needed.\n\t */\n\tpublic constructor(type: string, message: MessagePrompterMessage, options?: IMessagePrompterStrategyOptions) {\n\t\tthis.type = type;\n\t\tthis.timeout = options?.timeout ?? MessagePrompterBaseStrategy.defaultStrategyOptions.timeout ?? 10 * 1000;\n\t\tthis.explicitReturn = options?.explicitReturn ?? MessagePrompterBaseStrategy.defaultStrategyOptions.explicitReturn ?? false;\n\t\tthis.editMessage = options?.editMessage ?? MessagePrompterBaseStrategy.defaultStrategyOptions.editMessage ?? undefined;\n\t\tthis.message = message;\n\t}\n\n\tpublic abstract run(channel: MessagePrompterChannelTypes, authorOrFilter: User | CollectorFilter<unknown[]>): Awaitable<unknown>;\n\n\tprotected async collectReactions(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>,\n\t\treactions: string[] | EmojiIdentifierResolvable[]\n\t): Promise<IMessagePrompterExplicitReturnBase> {\n\t\tif (isTextBasedChannel(channel) && !isStageChannel(channel)) {\n\t\t\tif (!isNullish(this.editMessage) && this.editMessage.editable) {\n\t\t\t\tthis.appliedMessage = await this.editMessage.edit(this.message as ArgumentTypes<Message['edit']>[0]);\n\t\t\t} else {\n\t\t\t\tthis.appliedMessage = await channel.send(this.message);\n\t\t\t}\n\n\t\t\tconst collector = this.appliedMessage.createReactionCollector({\n\t\t\t\t...this.createReactionPromptFilter(reactions, authorOrFilter),\n\t\t\t\tmax: 1,\n\t\t\t\ttime: this.timeout\n\t\t\t});\n\n\t\t\tlet resolved = false;\n\t\t\tconst collected: Promise<MessageReaction> = new Promise<MessageReaction>((resolve, reject) => {\n\t\t\t\tcollector.on('collect', (r) => {\n\t\t\t\t\tresolve(r);\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tcollector.stop();\n\t\t\t\t});\n\n\t\t\t\tcollector.on('end', (collected) => {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tif (!collected.size) reject(new Error('Collector has ended'));\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tfor (const reaction of reactions) {\n\t\t\t\tif (resolved) break;\n\n\t\t\t\tawait this.appliedMessage.react(reaction);\n\t\t\t}\n\n\t\t\tconst firstReaction = await collected;\n\t\t\tconst emoji = firstReaction?.emoji;\n\n\t\t\tconst reaction = reactions.find((r) => (emoji?.id ?? emoji?.name) === r);\n\n\t\t\treturn {\n\t\t\t\temoji,\n\t\t\t\treaction,\n\t\t\t\tstrategy: this,\n\t\t\t\tappliedMessage: this.appliedMessage,\n\t\t\t\tmessage: this.message\n\t\t\t};\n\t\t}\n\n\t\tthrow new Error('A channel was provided to which I am not able to send messages');\n\t}\n\n\t/**\n\t * Creates a filter for the collector to filter on\n\t * @return The filter for awaitReactions function\n\t */\n\tprotected createReactionPromptFilter(\n\t\treactions: string[] | EmojiIdentifierResolvable[],\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>\n\t): CollectorOptions<[MessageReaction, User]> {\n\t\treturn {\n\t\t\tfilter: async (reaction: MessageReaction, user: User) =>\n\t\t\t\treactions.includes(reaction.emoji.id ?? reaction.emoji.name ?? '') &&\n\t\t\t\t(typeof authorOrFilter === 'function' ? await authorOrFilter(reaction, user) : user.id === authorOrFilter.id) &&\n\t\t\t\t!user.bot\n\t\t};\n\t}\n\n\t/**\n\t * The default strategy options\n\t */\n\tpublic static defaultStrategyOptions: IMessagePrompterStrategyOptions = {\n\t\ttimeout: 10 * 1000,\n\t\texplicitReturn: false,\n\t\teditMessage: undefined\n\t};\n}\n","import type { CollectorFilter, EmojiResolvable, MessageReaction, User } from 'discord.js';\nimport type { IMessagePrompterExplicitConfirmReturn } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterConfirmStrategyOptions } from '../strategyOptions';\nimport { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';\n\nexport class MessagePrompterConfirmStrategy extends MessagePrompterBaseStrategy implements IMessagePrompterConfirmStrategyOptions {\n\t/**\n\t * The confirm emoji used\n\t */\n\tpublic confirmEmoji: string | EmojiResolvable;\n\n\t/**\n\t * The cancel emoji used\n\t */\n\tpublic cancelEmoji: string | EmojiResolvable;\n\n\t/**\n\t * Constructor for the {@link MessagePrompterBaseStrategy} class\n\t * @param message The message to be sent {@link MessagePrompter}\n\t * @param options Overrideable options if needed.\n\t */\n\tpublic constructor(message: MessagePrompterMessage, options?: IMessagePrompterConfirmStrategyOptions) {\n\t\tsuper('confirm', message, options);\n\n\t\tthis.confirmEmoji = options?.confirmEmoji ?? MessagePrompterConfirmStrategy.confirmEmoji;\n\t\tthis.cancelEmoji = options?.cancelEmoji ?? MessagePrompterConfirmStrategy.cancelEmoji;\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals confirm.\n\t * The handler will wait for one (1) reaction.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t * @returns A promise that resolves to a boolean denoting the value of the input (`true` for yes, `false` for no).\n\t */\n\tpublic override async run(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>\n\t): Promise<IMessagePrompterExplicitConfirmReturn | boolean> {\n\t\tconst response = await this.collectReactions(channel, authorOrFilter, [this.confirmEmoji, this.cancelEmoji]);\n\n\t\tconst confirmed = (response?.emoji?.id ?? response?.emoji?.name) === this.confirmEmoji;\n\n\t\t// prettier-ignore\n\t\treturn this.explicitReturn ? { ...response, confirmed } : confirmed;\n\t}\n\n\t/**\n\t * The default confirm emoji used for {@link MessagePrompterConfirmStrategy}\n\t */\n\tpublic static confirmEmoji: string | EmojiResolvable = '🇾';\n\n\t/**\n\t * The default cancel emoji used for {@link MessagePrompterConfirmStrategy}\n\t */\n\tpublic static cancelEmoji: string | EmojiResolvable = '🇳';\n}\n","import { isNullish, type ArgumentTypes } from '@sapphire/utilities';\nimport type { CollectorFilter, CollectorOptions, Message, User } from 'discord.js';\nimport { isStageChannel, isTextBasedChannel } from '../../type-guards';\nimport type { IMessagePrompterExplicitMessageReturn } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterStrategyOptions } from '../strategyOptions';\nimport { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';\n\nexport class MessagePrompterMessageStrategy extends MessagePrompterBaseStrategy implements IMessagePrompterStrategyOptions {\n\t/**\n\t * Constructor for the {@link MessagePrompterBaseStrategy} class\n\t * @param message The message instance for this {@link MessagePrompter}\n\t * @param options Overrideable options if needed.\n\t */\n\tpublic constructor(message: MessagePrompterMessage, options: IMessagePrompterStrategyOptions) {\n\t\tsuper('message', message, options);\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals message.\n\t * The handler will wait for one (1) message.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t * @returns A promise that resolves to the message object received.\n\t */\n\tpublic override async run(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[Message]>\n\t): Promise<IMessagePrompterExplicitMessageReturn | Message> {\n\t\tif (isTextBasedChannel(channel) && !isStageChannel(channel)) {\n\t\t\tif (!isNullish(this.editMessage) && this.editMessage.editable) {\n\t\t\t\tthis.appliedMessage = await this.editMessage.edit(this.message as ArgumentTypes<Message['edit']>[0]);\n\t\t\t} else {\n\t\t\t\tthis.appliedMessage = await channel.send(this.message);\n\t\t\t}\n\n\t\t\tconst collector = await channel.awaitMessages({\n\t\t\t\t...this.createMessagePromptFilter(authorOrFilter),\n\t\t\t\tmax: 1,\n\t\t\t\ttime: this.timeout,\n\t\t\t\terrors: ['time']\n\t\t\t});\n\t\t\tconst response = collector.first();\n\n\t\t\tif (!response) {\n\t\t\t\tthrow new Error('No messages received');\n\t\t\t}\n\n\t\t\treturn this.explicitReturn\n\t\t\t\t? {\n\t\t\t\t\t\tresponse,\n\t\t\t\t\t\tstrategy: this,\n\t\t\t\t\t\tappliedMessage: this.appliedMessage,\n\t\t\t\t\t\tmessage: this.message\n\t\t\t\t\t}\n\t\t\t\t: response;\n\t\t}\n\n\t\tthrow new Error('A channel was provided to which I am not able to send messages');\n\t}\n\n\t/**\n\t * Creates a filter for the collector to filter on\n\t * @return The filter for awaitMessages function\n\t */\n\tprivate createMessagePromptFilter(authorOrFilter: User | CollectorFilter<[Message]>): CollectorOptions<[Message]> {\n\t\treturn {\n\t\t\tfilter: async (message: Message) =>\n\t\t\t\t(typeof authorOrFilter === 'function' ? await authorOrFilter(message) : message.author.id === authorOrFilter.id) &&\n\t\t\t\t!message.author.bot\n\t\t};\n\t}\n}\n","import type { CollectorFilter, EmojiIdentifierResolvable, MessageReaction, User } from 'discord.js';\nimport type { IMessagePrompterExplicitNumberReturn } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterNumberStrategyOptions } from '../strategyOptions';\nimport { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';\n\nexport class MessagePrompterNumberStrategy extends MessagePrompterBaseStrategy implements IMessagePrompterNumberStrategyOptions {\n\t/**\n\t * The available number emojis\n\t */\n\tpublic numberEmojis: EmojiIdentifierResolvable[];\n\t/**\n\t * The available number emojis\n\t */\n\tpublic start: number;\n\t/**\n\t * The available number emojis\n\t */\n\tpublic end: number;\n\n\t/**\n\t * Constructor for the {@link MessagePrompterBaseStrategy} class\n\t * @param message The message instance for this {@link MessagePrompter}\n\t * @param options Overrideable options if needed.\n\t */\n\tpublic constructor(message: MessagePrompterMessage, options: IMessagePrompterNumberStrategyOptions) {\n\t\tsuper('number', message, options);\n\n\t\tthis.numberEmojis = options?.numberEmojis ?? MessagePrompterNumberStrategy.numberEmojis;\n\t\tthis.start = options?.start ?? 0;\n\t\tthis.end = options?.end ?? 10;\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals number.\n\t * The handler will wait for one (1) reaction.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t * @returns A promise that resolves to the selected number within the range.\n\t */\n\tpublic async run(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>\n\t): Promise<IMessagePrompterExplicitNumberReturn | number> {\n\t\t// 0 and 10 are the maximum available emojis as a number\n\t\tif (this.start < 0) throw new TypeError('Starting number cannot be less than 0.');\n\t\tif (this.end > 10) throw new TypeError('Ending number cannot be more than 10.');\n\n\t\tconst numbers = Array.from({ length: this.end - this.start + 1 }, (_, n: number) => n + this.start);\n\t\tconst emojis = this.numberEmojis.slice(this.start, this.end);\n\t\tconst response = await this.collectReactions(channel, authorOrFilter, emojis);\n\n\t\tconst emojiIndex = emojis.findIndex((emoji) => (response?.emoji?.id ?? response?.emoji?.name) === emoji);\n\t\tconst number = numbers[emojiIndex];\n\n\t\t// prettier-ignore\n\t\treturn this.explicitReturn ? { ...response, number } : number;\n\t}\n\n\t/**\n\t * The default available number emojis\n\t */\n\tpublic static numberEmojis = ['0️⃣', '1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣', '🔟'];\n}\n","import type { CollectorFilter, EmojiIdentifierResolvable, EmojiResolvable, MessageReaction, User } from 'discord.js';\nimport type { IMessagePrompterExplicitReturnBase } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterReactionStrategyOptions } from '../strategyOptions';\nimport { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';\n\nexport class MessagePrompterReactionStrategy extends MessagePrompterBaseStrategy implements MessagePrompterReactionStrategy {\n\t/**\n\t * The emojis used\n\t */\n\tpublic reactions: EmojiIdentifierResolvable[];\n\n\t/**\n\t * Constructor for the {@link MessagePrompterReactionStrategy} class\n\t * @param message The message instance for this {@link MessagePrompter}\n\t * @param options Overrideable options if needed.\n\t */\n\tpublic constructor(message: MessagePrompterMessage, options: IMessagePrompterReactionStrategyOptions) {\n\t\tsuper('reactions', message, options);\n\n\t\tthis.reactions = options?.reactions;\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompterReactionStrategy} and sends the message.\n\t * The handler will wait for one (1) reaction.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t * @returns A promise that resolves to the reaction object.\n\t */\n\tpublic async run(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>\n\t): Promise<IMessagePrompterExplicitReturnBase | string | EmojiResolvable> {\n\t\tif (!this.reactions?.length) throw new TypeError('There are no reactions provided.');\n\n\t\tconst response = await this.collectReactions(channel, authorOrFilter, this.reactions);\n\n\t\treturn this.explicitReturn ? response : (response.reaction ?? response);\n\t}\n}\n","import type { Ctor } from '@sapphire/utilities';\nimport type { CollectorFilter, EmojiResolvable, Message, MessageReaction, User } from 'discord.js';\nimport type {\n\tIMessagePrompterExplicitConfirmReturn,\n\tIMessagePrompterExplicitMessageReturn,\n\tIMessagePrompterExplicitNumberReturn,\n\tIMessagePrompterExplicitReturnBase\n} from './ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from './constants';\nimport { MessagePrompterBaseStrategy } from './strategies/MessagePrompterBaseStrategy';\nimport { MessagePrompterConfirmStrategy } from './strategies/MessagePrompterConfirmStrategy';\nimport { MessagePrompterMessageStrategy } from './strategies/MessagePrompterMessageStrategy';\nimport { MessagePrompterNumberStrategy } from './strategies/MessagePrompterNumberStrategy';\nimport { MessagePrompterReactionStrategy } from './strategies/MessagePrompterReactionStrategy';\nimport type {\n\tIMessagePrompterConfirmStrategyOptions,\n\tIMessagePrompterNumberStrategyOptions,\n\tIMessagePrompterReactionStrategyOptions,\n\tIMessagePrompterStrategyOptions\n} from './strategyOptions';\n\nexport interface StrategyReturns {\n\tconfirm: IMessagePrompterExplicitConfirmReturn | boolean;\n\tmessage: IMessagePrompterExplicitMessageReturn | Message;\n\tnumber: IMessagePrompterExplicitNumberReturn | number;\n\treaction: IMessagePrompterExplicitReturnBase | string | EmojiResolvable;\n}\n\nexport interface StrategyOptions {\n\tconfirm: IMessagePrompterConfirmStrategyOptions;\n\tmessage: IMessagePrompterStrategyOptions;\n\tnumber: IMessagePrompterNumberStrategyOptions;\n\treaction: IMessagePrompterReactionStrategyOptions;\n}\n\nexport interface StrategyFilters {\n\tconfirm: [MessageReaction, User];\n\tmessage: [Message];\n\tnumber: [MessageReaction, User];\n\treaction: [MessageReaction, User];\n}\n\n/**\n * This is a {@link MessagePrompter}, a utility that sends a message, prompting for user input. The prompt can resolve to any kind of input.\n * There are several specifiable types to prompt for user input, and they are as follows:\n * - Confirm\n * This will send a simple Yes/No prompt, using reactions.\n * - Number\n * This will prompt for an integer. By default it will be a number between 0 and 10 (inclusive), however you can also specify your own custom range (inclusive).\n * - Reactions\n * This can be any kind of reaction emoji that Discord supports, and as many as you want. This type will return that reaction instead of a boolean.\n * - Message\n * This will prompt the user and require a response in the form of a message. This can be helpful if you require a user to upload an image for example, or give text input.\n *\n * You must either use this class directly or extend it.\n *\n * {@link MessagePrompter} uses reactions to prompt for a yes/no answer and returns it.\n * You can modify the confirm and cancel reaction used for each message, or use the {@link MessagePrompter.defaultPrompts}.\n * {@link MessagePrompter.defaultPrompts} is also static so you can modify these directly.\n *\n * @example\n * ```typescript\n * const { MessagePrompter } = require('@sapphire/discord.js-utilities');\n *\n * const handler = new MessagePrompter('Are you sure you want to continue?');\n * const result = await handler.run(channel, author);\n * ```\n *\n * @example\n * ```typescript\n * const { MessagePrompter } = require('@sapphire/discord.js-utilities');\n *\n * const handler = new MessagePrompter('Choose a number between 5 and 10?', 'number', {\n * \t\tstart: 5,\n * \t\tend: 10\n * });\n * const result = await handler.run(channel, author);\n * ```\n *\n * @example\n * ```typescript\n * const { MessagePrompter } = require('@sapphire/discord.js-utilities');\n *\n * const handler = new MessagePrompter('Are you happy or sad?', 'reaction', {\n * \t\treactions: ['🙂', '🙁']\n * });\n * const result = await handler.run(channel, author);\n * ```\n *\n * @example\n * ```typescript\n * const { MessagePrompter } = require('@sapphire/discord.js-utilities');\n *\n * const handler = new MessagePrompter('Do you love me?', 'message');\n * const result = await handler.run(channel, author);\n * ```\n */\nexport class MessagePrompter<S extends keyof StrategyReturns = 'confirm'> {\n\t/**\n\t * The strategy used in {@link MessagePrompter.run}\n\t */\n\tpublic strategy: MessagePrompterBaseStrategy;\n\n\t/**\n\t * Constructor for the {@link MessagePrompter} class\n\t * @param message The message to send.\n\t * @param strategy The strategy name or Instance to use\n\t * @param strategyOptions The options that are passed to the strategy\n\t */\n\tpublic constructor(\n\t\tmessage: MessagePrompterMessage | MessagePrompterBaseStrategy,\n\t\tstrategy?: S,\n\t\tstrategyOptions?: S extends keyof StrategyOptions ? StrategyOptions[S] : never\n\t) {\n\t\tlet strategyToRun: MessagePrompterBaseStrategy;\n\n\t\tif (message instanceof MessagePrompterBaseStrategy) {\n\t\t\tstrategyToRun = message;\n\t\t} else {\n\t\t\tconst mapStrategy = MessagePrompter.strategies.get(strategy ?? MessagePrompter.defaultStrategy);\n\n\t\t\tif (!mapStrategy) {\n\t\t\t\tthrow new Error('No strategy provided');\n\t\t\t}\n\n\t\t\tstrategyToRun = new mapStrategy(message, strategyOptions);\n\t\t}\n\n\t\tthis.strategy = strategyToRun;\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompter} and sends the message.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t */\n\tpublic run<Filter extends S extends keyof StrategyFilters ? StrategyFilters[S] : unknown[]>(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<Filter>\n\t): S extends keyof StrategyReturns ? Promise<StrategyReturns[S]> : never {\n\t\treturn this.strategy.run(channel, authorOrFilter as User | CollectorFilter<unknown[]>) as S extends keyof StrategyReturns\n\t\t\t? Promise<StrategyReturns[S]>\n\t\t\t: never;\n\t}\n\n\t/**\n\t * The available strategies\n\t */\n\tpublic static readonly strategies: Map<\n\t\tkeyof StrategyReturns,\n\t\tCtor<\n\t\t\t| ConstructorParameters<typeof MessagePrompterConfirmStrategy>\n\t\t\t| ConstructorParameters<typeof MessagePrompterNumberStrategy>\n\t\t\t| ConstructorParameters<typeof MessagePrompterReactionStrategy>\n\t\t\t| ConstructorParameters<typeof MessagePrompterMessageStrategy>,\n\t\t\tMessagePrompterConfirmStrategy | MessagePrompterNumberStrategy | MessagePrompterReactionStrategy | MessagePrompterMessageStrategy\n\t\t>\n\t\t// @ts-expect-error 2322\n\t> = new Map([\n\t\t['confirm', MessagePrompterConfirmStrategy],\n\t\t['number', MessagePrompterNumberStrategy],\n\t\t['reaction', MessagePrompterReactionStrategy],\n\t\t['message', MessagePrompterMessageStrategy]\n\t]);\n\n\t/**\n\t * The default strategy to use\n\t */\n\tpublic static defaultStrategy: keyof StrategyReturns = 'confirm';\n}\n","import { chunk, partition } from '@sapphire/utilities';\nimport {\n\tActionRowBuilder,\n\tButtonBuilder,\n\tButtonStyle,\n\tComponentType,\n\ttype APIActionRowComponent,\n\ttype APIComponentInMessageActionRow,\n\ttype ActionRowComponentOptions,\n\ttype ButtonComponentData,\n\ttype ChannelSelectMenuComponentData,\n\ttype MentionableSelectMenuComponentData,\n\ttype MessageActionRowComponentBuilder,\n\ttype RoleSelectMenuComponentData,\n\ttype StringSelectMenuComponentData,\n\ttype UserSelectMenuComponentData,\n\ttype APIButtonComponent\n} from 'discord.js';\nimport { isAnyInteractableInteraction, isMessageInstance } from '../type-guards';\nimport type {\n\tPaginatedMessageAction,\n\tPaginatedMessageActionButton,\n\tPaginatedMessageActionChannelMenu,\n\tPaginatedMessageActionLink,\n\tPaginatedMessageActionMentionableMenu,\n\tPaginatedMessageActionRoleMenu,\n\tPaginatedMessageActionStringMenu,\n\tPaginatedMessageActionUserMenu,\n\tPaginatedMessageComponentUnion,\n\tSafeReplyToInteractionParameters\n} from './PaginatedMessageTypes';\n\n/**\n * Checks if a PaginatedMessageAction is a button or menu.\n * @param action The PaginatedMessageAction to check.\n * @returns `true` if the action is a button or menu, `false` otherwise.\n */\nexport function actionIsButtonOrMenu(action: PaginatedMessageAction): action is Exclude<PaginatedMessageAction, PaginatedMessageActionLink> {\n\treturn (\n\t\taction.type === ComponentType.Button ||\n\t\taction.type === ComponentType.StringSelect ||\n\t\taction.type === ComponentType.UserSelect ||\n\t\taction.type === ComponentType.RoleSelect ||\n\t\taction.type === ComponentType.MentionableSelect ||\n\t\taction.type === ComponentType.ChannelSelect\n\t);\n}\n\n/**\n * Checks if a PaginatedMessageAction is a button with {@link ButtonStyle.Link style `link`}.\n * @param action The PaginatedMessageAction to check.\n * @returns `true` if the action is a button with {@link ButtonStyle.Link style `link`}, `false` otherwise.\n */\nexport function actionIsLinkButton(action: PaginatedMessageAction): action is PaginatedMessageActionLink {\n\treturn action.type === ComponentType.Button && action.style === ButtonStyle.Link;\n}\n\n/**\n * Checks if the given interaction is a button interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a button interaction, false otherwise.\n */\nexport function isMessageButtonInteractionData(interaction: ActionRowComponentOptions): interaction is ButtonComponentData {\n\treturn interaction.type === ComponentType.Button;\n}\n\n/**\n * Checks if the given interaction is a string select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a string select interaction, false otherwise.\n */\nexport function isMessageStringSelectInteractionData(interaction: ActionRowComponentOptions): interaction is StringSelectMenuComponentData {\n\treturn interaction.type === ComponentType.StringSelect;\n}\n\n/**\n * Checks if the given interaction is a user select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a user select interaction, false otherwise.\n */\nexport function isMessageUserSelectInteractionData(interaction: ActionRowComponentOptions): interaction is UserSelectMenuComponentData {\n\treturn interaction.type === ComponentType.UserSelect;\n}\n\n/**\n * Checks if the given interaction is a role select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a role select interaction, false otherwise.\n */\nexport function isMessageRoleSelectInteractionData(interaction: ActionRowComponentOptions): interaction is RoleSelectMenuComponentData {\n\treturn interaction.type === ComponentType.RoleSelect;\n}\n\n/**\n * Checks if the given interaction is a mentionable select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a mentionable select interaction, false otherwise.\n */\nexport function isMessageMentionableSelectInteractionData(interaction: ActionRowComponentOptions): interaction is MentionableSelectMenuComponentData {\n\treturn interaction.type === ComponentType.MentionableSelect;\n}\n\n/**\n * Checks if the given interaction is a channel select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a channel select interaction, false otherwise.\n */\nexport function isMessageChannelSelectInteractionData(interaction: ActionRowComponentOptions): interaction is ChannelSelectMenuComponentData {\n\treturn interaction.type === ComponentType.ChannelSelect;\n}\n\n/**\n * Checks if the given component is a button builder.\n * @param component - The component to check.\n * @returns True if the component is a button builder, false otherwise.\n */\nexport function isButtonComponentBuilder(component: MessageActionRowComponentBuilder): component is ButtonBuilder {\n\treturn component.data.type === ComponentType.Button;\n}\n\n/**\n * Checks if the given action is a paginated message action button.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action button, false otherwise.\n */\nexport function isActionButton(action: PaginatedMessageAction): action is PaginatedMessageActionButton {\n\treturn action.type === ComponentType.Button && action.style !== ButtonStyle.Link;\n}\n\n/**\n * Checks if the given action is a paginated message action link.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action link, false otherwise.\n */\nexport function isActionLink(action: PaginatedMessageAction): action is PaginatedMessageActionLink {\n\treturn action.type === ComponentType.Button && action.style === ButtonStyle.Link;\n}\n\n/**\n * Checks if the given action is a paginated message action string menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action string menu, false otherwise.\n */\nexport function isActionStringMenu(action: PaginatedMessageAction): action is PaginatedMessageActionStringMenu {\n\treturn action.type === ComponentType.StringSelect;\n}\n\n/**\n * Checks if the given action is a paginated message action user menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action user menu, false otherwise.\n */\nexport function isActionUserMenu(action: PaginatedMessageAction): action is PaginatedMessageActionUserMenu {\n\treturn action.type === ComponentType.UserSelect;\n}\n\n/**\n * Checks if the given action is a paginated message action role menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action role menu, false otherwise.\n */\nexport function isActionRoleMenu(action: PaginatedMessageAction): action is PaginatedMessageActionRoleMenu {\n\treturn action.type === ComponentType.RoleSelect;\n}\n\n/**\n * Checks if the given action is a paginated message action mentionable menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action mentionable menu, false otherwise.\n */\nexport function isActionMentionableMenu(action: PaginatedMessageAction): action is PaginatedMessageActionMentionableMenu {\n\treturn action.type === ComponentType.MentionableSelect;\n}\n\n/**\n * Checks if the given action is a paginated message action channel menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action channel menu, false otherwise.\n */\nexport function isActionChannelMenu(action: PaginatedMessageAction): action is PaginatedMessageActionChannelMenu {\n\treturn action.type === ComponentType.ChannelSelect;\n}\n\n/**\n * Creates partitioned message rows based on the provided components.\n * @param components The array of MessageActionRowComponentBuilder objects.\n * @returns An array of `APIActionRowComponent<APIComponentInMessageActionRow>` objects.\n */\nexport function createPartitionedMessageRow(components: MessageActionRowComponentBuilder[]): PaginatedMessageComponentUnion[] {\n\t// Partition the components into two groups: buttons and select menus\n\tconst [messageButtons, selectMenus] = partition(components, isButtonComponentBuilder);\n\tconst [actionButtons, linkButtons] = partition(messageButtons, (value) => (value.data as Partial<APIButtonComponent>).style !== ButtonStyle.Link);\n\n\t// Chunk the button components in sets of 5, the maximum of 1 ActionRowBuilder\n\tconst chunkedActionButtonComponents = chunk(actionButtons, 5);\n\n\t// Map all the button components to ActionRowBuilders\n\tconst messageActionButtonActionRows = chunkedActionButtonComponents.map((componentsChunk) =>\n\t\tnew ActionRowBuilder() //\n\t\t\t.setComponents(componentsChunk)\n\t);\n\n\t// Map all the select menu components to ActionRowBuilders\n\tconst selectMenuActionRows = selectMenus.map((component) =>\n\t\tnew ActionRowBuilder() //\n\t\t\t.setComponents(component)\n\t);\n\n\t// Chunk the button components in sets of 5, the maximum of 1 ActionRowBuilder\n\tconst chunkedLinkButtonComponents = chunk(linkButtons, 5);\n\n\t// Map all the button components to ActionRowBuilders\n\tconst messageLinkButtonActionRows = chunkedLinkButtonComponents.map((componentsChunk) =>\n\t\tnew ActionRowBuilder() //\n\t\t\t.setComponents(componentsChunk)\n\t);\n\n\treturn [...messageActionButtonActionRows, ...selectMenuActionRows, ...messageLinkButtonActionRows].map((actionRow) =>\n\t\tactionRow.toJSON()\n\t) as APIActionRowComponent<APIComponentInMessageActionRow>[];\n}\n\n/**\n * Safely replies to a message or interaction. This is primarily to save duplicated code in the main `PaginatedMessage` class\n * @param parameters The parameters to create a safe reply to interaction parameters\n */\nexport async function safelyReplyToInteraction<T extends 'edit' | 'reply'>(parameters: SafeReplyToInteractionParameters<T>) {\n\tif (isAnyInteractableInteraction(parameters.messageOrInteraction)) {\n\t\tif (parameters.messageOrInteraction.replied || parameters.messageOrInteraction.deferred) {\n\t\t\tawait parameters.messageOrInteraction.editReply(parameters.interactionEditReplyContent);\n\t\t} else if (parameters.messageOrInteraction.isMessageComponent()) {\n\t\t\tawait parameters.messageOrInteraction.update(parameters.componentUpdateContent);\n\t\t} else {\n\t\t\tawait parameters.messageOrInteraction.reply(parameters.interactionReplyContent);\n\t\t}\n\t} else if (parameters.messageMethodContent && parameters.messageMethod && isMessageInstance(parameters.messageOrInteraction)) {\n\t\tawait parameters.messageOrInteraction[parameters.messageMethod](parameters.messageMethodContent as any);\n\t}\n}\n","import { Time } from '@sapphire/duration';\nimport { deepClone, isFunction, isNullish, isObject, type Awaitable } from '@sapphire/utilities';\nimport {\n\tButtonBuilder,\n\tButtonStyle,\n\tChannelSelectMenuBuilder,\n\tComponentType,\n\tEmbedBuilder,\n\tGatewayIntentBits,\n\tIntentsBitField,\n\tInteractionCollector,\n\tInteractionType,\n\tMentionableSelectMenuBuilder,\n\tMessageFlags,\n\tPartials,\n\tRoleSelectMenuBuilder,\n\tStringSelectMenuBuilder,\n\tUserSelectMenuBuilder,\n\tisJSONEncodable,\n\tuserMention,\n\ttype APIEmbed,\n\ttype BaseMessageOptions,\n\ttype Collection,\n\ttype JSONEncodable,\n\ttype Message,\n\ttype MessageActionRowComponentBuilder,\n\ttype Snowflake,\n\ttype User\n} from 'discord.js';\nimport { MessageBuilder } from '../builders/MessageBuilder';\nimport { isAnyInteraction, isGuildBasedChannel, isMessageInstance, isTextBasedChannel } from '../type-guards';\nimport type { AnyInteractableInteraction } from '../utility-types';\nimport type {\n\tEmbedResolvable,\n\tPaginatedMessageAction,\n\tPaginatedMessageComponentUnion,\n\tPaginatedMessageEmbedResolvable,\n\tPaginatedMessageInteractionUnion,\n\tPaginatedMessageInternationalizationContext,\n\tPaginatedMessageMessageOptionsUnion,\n\tPaginatedMessageOptions,\n\tPaginatedMessagePage,\n\tPaginatedMessageResolvedPage,\n\tPaginatedMessageSelectMenuOptionsFunction,\n\tPaginatedMessageStopReasons,\n\tPaginatedMessageWriteableEmbedResolvable,\n\tPaginatedMessageWrongUserInteractionReplyFunction\n} from './PaginatedMessageTypes';\nimport {\n\tactionIsButtonOrMenu,\n\tactionIsLinkButton,\n\tcreatePartitionedMessageRow,\n\tisMessageButtonInteractionData,\n\tisMessageChannelSelectInteractionData,\n\tisMessageMentionableSelectInteractionData,\n\tisMessageRoleSelectInteractionData,\n\tisMessageStringSelectInteractionData,\n\tisMessageUserSelectInteractionData,\n\tsafelyReplyToInteraction\n} from './utils';\n\n/**\n * This is a {@link PaginatedMessage}, a utility to paginate messages (usually embeds).\n * You must either use this class directly or extend it.\n *\n * @remark Please note that for {@link PaginatedMessage} to work in DMs to your client, you need to add the `'CHANNEL'` partial to your `client.options.partials`.\n * Message based commands can always be used in DMs, whereas Chat Input interactions can only be used in DMs when they are registered globally.\n *\n * {@link PaginatedMessage} uses {@linkplain https://discord.js.org/docs/packages/discord.js/main/MessageComponent:TypeAlias MessageComponent} buttons that perform the specified action when clicked.\n * You can either use your own actions or the {@link PaginatedMessage.defaultActions}.\n * {@link PaginatedMessage.defaultActions} is also static so you can modify these directly.\n *\n * {@link PaginatedMessage} also uses pages via {@linkplain https://discord.js.org/docs/packages/discord.js/main/Message:Class Messages}.\n *\n * @example\n * ```typescript\n * const myPaginatedMessage = new PaginatedMessage();\n * // Once you have an instance of PaginatedMessage you can call various methods on it to add pages to it.\n * // For more details see each method's documentation.\n *\n * myPaginatedMessage.addPageEmbed((embed) => {\n *\t\tembed\n *\t\t\t.setColor('#FF0000')\n *\t\t\t.setDescription('example description');\n *\n *\t\treturn embed;\n * });\n *\n * myPaginatedMessage.addPageBuilder((builder) => {\n *\t\tconst embed = new EmbedBuilder()\n *\t\t\t.setColor('#FF0000')\n *\t\t\t.setDescription('example description');\n *\n *\t\treturn builder\n *\t\t\t.setContent('example content')\n *\t\t\t.setEmbeds([embed]);\n * });\n *\n * myPaginatedMessage.addPageContent('Example');\n *\n * myPaginatedMessage.run(message)\n * ```\n *\n * @remark You can also provide a EmbedBuilder template. This will be applied to every page.\n * If a page itself has an embed then the two will be merged, with the content of\n * the page's embed taking priority over the template.\n *\n * Furthermore, if the template has a footer then it will be applied _after_ the page index part of the footer\n * with a space preceding the template. For example, when setting `- Powered by Sapphire Framework`\n * the resulting footer will be `1/2 - Powered by Sapphire Framework`\n * @example\n * ```typescript\n * const myPaginatedMessage = new PaginatedMessage({\n * \ttemplate: new EmbedBuilder().setColor('#FF0000').setFooter('- Powered by Sapphire framework')\n * });\n * ```\n *\n * @remark To utilize actions you can implement IPaginatedMessageAction into a class.\n * @example\n * ```typescript\n * class ForwardAction implements IPaginatedMessageAction {\n * public id = '▶️';\n *\n * public run({ handler }) {\n * if (handler.index !== handler.pages.length - 1) ++handler.index;\n * }\n * }\n *\n * // You can also give the object directly.\n *\n * const StopAction: IPaginatedMessageAction = {\n * customId: 'CustomStopAction',\n * run: ({ collector }) => {\n * collector.stop();\n * }\n * }\n * ```\n */\nexport class PaginatedMessage {\n\t// #region public static class properties\n\t/**\n\t * The default actions of this handler.\n\t */\n\tpublic static defaultActions: PaginatedMessageAction[] = [\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.goToPage',\n\t\t\ttype: ComponentType.StringSelect,\n\t\t\toptions: [],\n\t\t\trun: ({ handler, interaction }) => interaction.isStringSelectMenu() && (handler.index = parseInt(interaction.values[0], 10))\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.firstPage',\n\t\t\tstyle: ButtonStyle.Primary,\n\t\t\temoji: '⏪',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ handler }) => (handler.index = 0)\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.previousPage',\n\t\t\tstyle: ButtonStyle.Primary,\n\t\t\temoji: '◀️',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ handler }) => {\n\t\t\t\tif (handler.index === 0) {\n\t\t\t\t\thandler.index = handler.pages.length - 1;\n\t\t\t\t} else {\n\t\t\t\t\t--handler.index;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.nextPage',\n\t\t\tstyle: ButtonStyle.Primary,\n\t\t\temoji: '▶️',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ handler }) => {\n\t\t\t\tif (handler.index === handler.pages.length - 1) {\n\t\t\t\t\thandler.index = 0;\n\t\t\t\t} else {\n\t\t\t\t\t++handler.index;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.goToLastPage',\n\t\t\tstyle: ButtonStyle.Primary,\n\t\t\temoji: '⏩',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ handler }) => (handler.index = handler.pages.length - 1)\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.stop',\n\t\t\tstyle: ButtonStyle.Danger,\n\t\t\temoji: '⏹️',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ collector }) => {\n\t\t\t\tcollector.stop();\n\t\t\t}\n\t\t}\n\t];\n\n\t/**\n\t * Whether to emit the warning about running a {@link PaginatedMessage} in a DM channel without the client the `'CHANNEL'` partial.\n\t * @remark When using message based commands (as opposed to Application Commands) then you will also need to specify the `DIRECT_MESSAGE` intent for {@link PaginatedMessage} to work.\n\t *\n\t * @remark To overwrite this property change it somewhere in a \"setup\" file, i.e. where you also call `client.login()` for your client.\n\t * Alternatively, you can also customize it on a per-PaginatedMessage basis by using `paginatedMessageInstance.setEmitPartialDMChannelWarning(newBoolean)`\n\t * @default true\n\t */\n\tpublic static emitPartialDMChannelWarning = true;\n\n\t/**\n\t * A list of `customId` that are bound to actions that will stop the {@link PaginatedMessage}\n\t * @default ['@sapphire/paginated-messages.stop']\n\t * @remark To overwrite this property change it somewhere in a \"setup\" file, i.e. where you also call `client.login()` for your client.\n\t * Alternatively, you can also customize it on a per-PaginatedMessage basis by using `paginatedMessageInstance.setStopPaginatedMessageCustomIds(customIds)`\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t *\n\t * PaginatedMessage.stopPaginatedMessageCustomIds = ['my-custom-stop-custom-id'];\n\t * ```\n\t */\n\tpublic static stopPaginatedMessageCustomIds = ['@sapphire/paginated-messages.stop'];\n\n\t/**\n\t * The reasons sent by {@linkplain https://discord.js.org/docs/packages/discord.js/main/InteractionCollector:Class#end InteractionCollector#end}\n\t * event when the message (or its owner) has been deleted.\n\t */\n\tpublic static deletionStopReasons = ['messageDelete', 'channelDelete', 'guildDelete'];\n\n\t/**\n\t * Custom text to show in front of the page index in the embed footer.\n\t * PaginatedMessage will automatically add a space (` `) after the given text. You do not have to add it yourself.\n\t * @default \"\"\n\t * @remark To overwrite this property change it somewhere in a \"setup\" file, i.e. where you also call `client.login()` for your client.\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t *\n\t * PaginatedMessage.pageIndexPrefix = 'Page';\n\t * // This will make the footer of the embed something like \"Page 1/2\"\n\t * ```\n\t */\n\tpublic static pageIndexPrefix = '';\n\n\t/**\n\t * Custom separator for the page index in the embed footer.\n\t * @default \"•\"\n\t * @remark To overwrite this property change it somewhere in a \"setup\" file, i.e. where you also call `client.login()` for your client.\n\t * Alternatively, you can also customize it on a per-PaginatedMessage basis by passing `embedFooterSeparator` in the options of the constructor.\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t *\n\t * PaginatedMessage.embedFooterSeparator = '|';\n\t * // This will make the separator of the embed footer something like \"Page 1/2 | Today at 4:20\"\n\t * ```\n\t */\n\tpublic static embedFooterSeparator = '•';\n\n\t/**\n\t * The messages that are currently being handled by a {@link PaginatedMessage}\n\t * The key is the ID of the message that triggered this {@link PaginatedMessage}\n\t *\n\t * This is to ensure that only 1 {@link PaginatedMessage} can run on a specified message at once.\n\t * This is important when having an editable commands solution.\n\t */\n\tpublic static readonly messages = new Map<string, PaginatedMessage>();\n\n\t/**\n\t * The current {@link InteractionCollector} handlers that are active.\n\t * The key is the ID of of the author who sent the message that triggered this {@link PaginatedMessage}\n\t *\n\t * This is to ensure that any given author can only trigger 1 {@link PaginatedMessage}.\n\t * This is important for performance reasons, and users should not have more than 1 {@link PaginatedMessage} open at once.\n\t */\n\tpublic static readonly handlers = new Map<string, PaginatedMessage>();\n\n\t/**\n\t * A generator for {@link MessageSelectOption} that will be used to generate the options for the {@link StringSelectMenuBuilder}.\n\t * We do not allow overwriting the {@link MessageSelectOption#value} property with this, as it is vital to how we handle\n\t * select menu interactions.\n\t *\n\t * @param pageIndex The index of the page to add to the {@link StringSelectMenuBuilder}. We will add 1 to this number because our pages are 0 based,\n\t * so this will represent the pages as seen by the user.\n\t * @default\n\t * ```ts\n\t * {\n\t * \tlabel: `Page ${pageIndex}`\n\t * }\n\t * ```\n\t * @remark To overwrite this property change it in a \"setup\" file prior to calling `client.login()` for your client.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t *\n\t * PaginatedMessage.selectMenuOptions = (pageIndex) => ({\n\t * \t label: `Go to page: ${pageIndex}`,\n\t * \t description: 'This is a description'\n\t * });\n\t * ```\n\t */\n\tpublic static selectMenuOptions: PaginatedMessageSelectMenuOptionsFunction = (pageIndex) => ({ label: `Page ${pageIndex}` });\n\n\t/**\n\t * A generator for {@link MessageComponentInteraction#reply} that will be called and sent whenever an untargeted user interacts with one of the buttons.\n\t * When modifying this it is recommended that the message is set to be ephemeral so only the user that is pressing the buttons can see them.\n\t * Furthermore, we also recommend setting `allowedMentions: { users: [], roles: [] }`, so you don't have to worry about accidentally pinging anyone.\n\t *\n\t * When setting just a string, we will add `{ flags: MessageFlags.Ephemeral, allowedMentions: { users: [], roles: [] } }` for you.\n\t *\n\t * @param targetUser The {@link User} this {@link PaginatedMessage} was intended for.\n\t * @param interactionUser The {@link User} that actually clicked the button.\n\t * @default\n\t * ```ts\n\t * import { userMention } from 'discord.js';\n\t *\n\t * {\n\t * \tcontent: `Please stop interacting with the components on this message. They are only for ${userMention(targetUser.id)}.`,\n\t * \tflags: MessageFlags.Ephemeral,\n\t * \tallowedMentions: { users: [], roles: [] }\n\t * }\n\t * ```\n\t * @remark To overwrite this property change it in a \"setup\" file prior to calling `client.login()` for your client.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t * import { userMention } from 'discord.js';\n\t *\n\t * // We will add ephemeral and no allowed mention for string only overwrites\n\t * PaginatedMessage.wrongUserInteractionReply = (targetUser) =>\n\t * `These buttons are only for ${userMention(targetUser.id)}. Press them as much as you want, but I won't do anything with your clicks.`;\n\t * ```\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t * import { userMention } from 'discord.js';\n\t *\n\t * PaginatedMessage.wrongUserInteractionReply = (targetUser) => ({\n\t * \tcontent: `These buttons are only for ${userMention(\n\t * \t\ttargetUser.id\n\t * \t)}. Press them as much as you want, but I won't do anything with your clicks.`,\n\t * \tflags: MessageFlags.Ephemeral,\n\t * \tallowedMentions: { users: [], roles: [] }\n\t * });\n\t * ```\n\t */\n\tpublic static wrongUserInteractionReply: PaginatedMessageWrongUserInteractionReplyFunction = (targetUser: User) => ({\n\t\tcontent: `Please stop interacting with the components on this message. They are only for ${userMention(targetUser.id)}.`,\n\t\tflags: MessageFlags.Ephemeral,\n\t\tallowedMentions: { users: [], roles: [] }\n\t});\n\t// #endregion\n\n\t// #region private static class properties\n\t/**\n\t * Resolves the template for the PaginatedMessage.\n\t *\n\t * @param template - The template to resolve.\n\t * @returns The resolved template as a BaseMessageOptions object.\n\t */\n\tprivate static resolveTemplate(template?: JSONEncodable<APIEmbed> | BaseMessageOptions): BaseMessageOptions {\n\t\tif (template === undefined) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (isJSONEncodable(template)) {\n\t\t\treturn { embeds: [template.toJSON()] };\n\t\t}\n\n\t\treturn template;\n\t}\n\t// #endregion\n\n\t// #region public class properties\n\t/**\n\t * The pages to be converted to {@link PaginatedMessage.messages}\n\t */\n\tpublic pages: PaginatedMessagePage[] = [];\n\n\t/**\n\t * The response message used to edit on page changes.\n\t */\n\tpublic response: Message | AnyInteractableInteraction | null = null;\n\n\t/**\n\t * The collector used for handling component interactions.\n\t */\n\tpublic collector: InteractionCollector<PaginatedMessageInteractionUnion> | null = null;\n\n\t/**\n\t * The pages which were converted from {@link PaginatedMessage.pages}\n\t */\n\tpublic messages: (PaginatedMessageResolvedPage | null)[] = [];\n\n\t/**\n\t * The actions which are to be used.\n\t */\n\tpublic actions = new Map<string, PaginatedMessageAction>();\n\n\t/**\n\t * The page-specific actions which are to be used.\n\t */\n\tpublic pageActions: (Map<string, PaginatedMessageAction> | null)[] = [];\n\n\t/**\n\t * The handler's current page/message index.\n\t */\n\tpublic index = 0;\n\n\t/**\n\t * The amount of milliseconds to idle before the paginator is closed.\n\t * @default 14.5 minutes\n\t * @remark This is to ensure it is a bit before interactions expire.\n\t */\n\tpublic idle = Time.Minute * 14.5;\n\n\t/**\n\t * The template for this {@link PaginatedMessage}.\n\t * You can use templates to set defaults that will apply to each and every page in the {@link PaginatedMessage}\n\t */\n\tpublic template: PaginatedMessageMessageOptionsUnion;\n\n\t/**\n\t * Custom text to show in front of the page index in the embed footer.\n\t * PaginatedMessage will automatically add a space (` `) after the given text. You do not have to add it yourself.\n\t * @default ```PaginatedMessage.pageIndexPrefix``` (static property)\n\t */\n\tpublic pageIndexPrefix = PaginatedMessage.pageIndexPrefix;\n\n\t/**\n\t * Custom separator to show after the page index in the embed footer.\n\t * PaginatedMessage will automatically add a space (` `) after the given text. You do not have to add it yourself.\n\t * @default ```PaginatedMessage.embedFooterSeparator``` (static property)\n\t */\n\tpublic embedFooterSeparator = PaginatedMessage.embedFooterSeparator;\n\n\t/**\n\t * A list of `customId` that are bound to actions that will stop the {@link PaginatedMessage}\n\t * @default ```PaginatedMessage.stopPaginatedMessageCustomIds``` (static property)\n\t */\n\tpublic stopPaginatedMessageCustomIds = PaginatedMessage.stopPaginatedMessageCustomIds;\n\n\t/**\n\t * Whether to emit the warning about running a {@link PaginatedMessage} in a DM channel without the client having the `'CHANNEL'` partial.\n\t * @remark When using message based commands (as opposed to Application Commands) then you will also need to specify the `DIRECT_MESSAGE` intent for {@link PaginatedMessage} to work.\n\t *\n\t * @default ```PaginatedMessage.emitPartialDMChannelWarning``` (static property)\n\t */\n\tpublic emitPartialDMChannelWarning = PaginatedMessage.emitPartialDMChannelWarning;\n\t// #endregion\n\n\t// #region protected class properties\n\t/**\n\t * Data for the paginated message.\n\t */\n\tprotected paginatedMessageData: Omit<PaginatedMessageMessageOptionsUnion, 'components'> | null = null;\n\n\t/**\n\t * The placeholder for the select menu.\n\t */\n\tprotected selectMenuPlaceholder: string | undefined = undefined;\n\n\t/**\n\t * Tracks whether a warning was already emitted for this {@link PaginatedMessage}\n\t * concerning the maximum amount of pages in the {@link SelectMenu}.\n\t *\n\t * @default false\n\t */\n\tprotected hasEmittedMaxPageWarning = false;\n\n\t/**\n\t * Tracks whether a warning was already emitted for this {@link PaginatedMessage}\n\t * concerning the {@link PaginatedMessage} being called in a `DMChannel`\n\t * without the client having the `'Channel'` partial.\n\t *\n\t * @remark When using message based commands (as opposed to Application Commands) then you will also need to specify the `DIRECT_MESSAGE` intent for {@link PaginatedMessage} to work.\n\t * @default false\n\t */\n\tprotected hasEmittedPartialDMChannelWarning = false;\n\n\t/**\n\t * Determines whether the default footer that shows the current page number should be added to the embeds.\n\t *\n\t * @note If this is set to false, i.e.e through {@link setShouldAddFooterToEmbeds}, then {@link embedFooterSeparator}\n\t * is never applied.\n\t *\n\t * @default true\n\t */\n\tprotected shouldAddFooterToEmbeds = true;\n\n\t/**\n\t * Function that returns the select menu options for the paginated message.\n\t * @param message The paginated message.\n\t * @returns The select menu options.\n\t */\n\tprotected selectMenuOptions: PaginatedMessageSelectMenuOptionsFunction = PaginatedMessage.selectMenuOptions;\n\n\t/**\n\t * Function that handles the reply when a user interacts with the paginated message incorrectly.\n\t */\n\tprotected wrongUserInteractionReply: PaginatedMessageWrongUserInteractionReplyFunction = PaginatedMessage.wrongUserInteractionReply;\n\t// #endregion\n\n\t// #region private class fields\n\t/** The response we send when someone gets into an invalid flow */\n\treadonly #thisMazeWasNotMeantForYouContent = { content: \"This maze wasn't meant for you...what did you do.\" };\n\t// #endregion\n\n\t/**\n\t * Constructor for the {@link PaginatedMessage} class\n\t * @param __namedParameters The {@link PaginatedMessageOptions} for this instance of the {@link PaginatedMessage} class\n\t */\n\tpublic constructor({\n\t\tpages,\n\t\tactions,\n\t\ttemplate,\n\t\tpageIndexPrefix,\n\t\tembedFooterSeparator,\n\t\tpaginatedMessageData = null\n\t}: PaginatedMessageOptions = {}) {\n\t\tif (pages) this.addPages(pages);\n\n\t\tthis.addActions(actions ?? this.constructor.defaultActions);\n\n\t\tthis.template = PaginatedMessage.resolveTemplate(template);\n\t\tthis.pageIndexPrefix = pageIndexPrefix ?? PaginatedMessage.pageIndexPrefix;\n\t\tthis.embedFooterSeparator = embedFooterSeparator ?? PaginatedMessage.embedFooterSeparator;\n\t\tthis.paginatedMessageData = paginatedMessageData;\n\t}\n\n\t// #region property setters\n\t/**\n\t * Sets the {@link PaginatedMessage.selectMenuOptions} for this instance of {@link PaginatedMessage}.\n\t * This will only apply to this one instance and no others.\n\t * @param newOptions The new options generator to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setSelectMenuOptions(newOptions: PaginatedMessageSelectMenuOptionsFunction): this {\n\t\tthis.selectMenuOptions = newOptions;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the {@link PaginatedMessage.selectMenuPlaceholder} for this instance of {@link PaginatedMessage}.\n\t *\n\t * This applies only to the string select menu from the {@link PaginatedMessage.defaultActions}\n\t * that offers \"go to page\" (we internally check the customId for this)\n\t *\n\t * This will only apply to this one instance and no others.\n\t * @param placeholder The new placeholder to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setSelectMenuPlaceholder(placeholder: string | undefined): this {\n\t\tthis.selectMenuPlaceholder = placeholder;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the {@link PaginatedMessage.wrongUserInteractionReply} for this instance of {@link PaginatedMessage}.\n\t * This will only apply to this one instance and no others.\n\t * @param wrongUserInteractionReply The new `wrongUserInteractionReply` to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setWrongUserInteractionReply(wrongUserInteractionReply: PaginatedMessageWrongUserInteractionReplyFunction): this {\n\t\tthis.wrongUserInteractionReply = wrongUserInteractionReply;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the {@link PaginatedMessage.stopPaginatedMessageCustomIds} for this instance of {@link PaginatedMessage}.\n\t * This will only apply to this one instance and no others.\n\t * @param stopPaginatedMessageCustomIds The new `stopPaginatedMessageCustomIds` to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setStopPaginatedMessageCustomIds(stopPaginatedMessageCustomIds: string[]): this {\n\t\tthis.stopPaginatedMessageCustomIds = stopPaginatedMessageCustomIds;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the {@link PaginatedMessage.emitPartialDMChannelWarning} for this instance of {@link PaginatedMessage}.\n\t * This will only apply to this one instance and no others.\n\t * @param emitPartialDMChannelWarning The new `emitPartialDMChannelWarning` to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setEmitPartialDMChannelWarning(emitPartialDMChannelWarning: boolean): this {\n\t\tthis.emitPartialDMChannelWarning = emitPartialDMChannelWarning;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the handler's current page/message index.\n\t * @param index The number to set the index to.\n\t */\n\tpublic setIndex(index: number): this {\n\t\tthis.index = index;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the amount of time to idle before the paginator is closed.\n\t * @param idle The number to set the idle to.\n\t */\n\tpublic setIdle(idle: number): this {\n\t\tthis.idle = idle;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value of {@link shouldAddFooterToEmbeds} property and returns the instance of the class.\n\t * @param newValue - The new value for {@link shouldAddFooterToEmbeds}.\n\t * @returns The instance of the class with the updated {@link shouldAddFooterToEmbeds} value.\n\t */\n\tpublic setShouldAddFooterToEmbeds(newValue: boolean): this {\n\t\tthis.shouldAddFooterToEmbeds = newValue;\n\t\treturn this;\n\t}\n\t// #endregion\n\n\t// #region actions related methods\n\t/**\n\t * Clears all current actions and sets them. The order given is the order they will be used.\n\t * @param actions The actions to set. This can be either a Button, Link Button, or Select Menu.\n\t * @param includeDefaultActions Whether to merge in the {@link PaginatedMessage.defaultActions} when setting the actions.\n\t * If you set this to true then you do not need to manually add `...PaginatedMessage.defaultActions` as seen in the first example.\n\t * The default value is `false` for backwards compatibility within the current major version.\n\t *\n\t * @remark You can retrieve the default actions for the regular pagination\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setActions([\n\t * ...PaginatedMessage.defaultActions,\n\t * ])\n\t * ```\n\t *\n\t * @remark You can add custom Message Buttons by providing `style`, `customId`, `type`, `run` and at least one of `label` or `emoji`.\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setActions([\n\t * {\n\t * style: 'PRIMARY',\n\t * label: 'My Button',\n\t * customId: 'custom_button',\n\t * type: ComponentType.Button,\n\t * run: (context) => console.log(context)\n\t * }\n\t * ], true);\n\t * ```\n\t *\n\t * @remark You can add custom Message **Link** Buttons by providing `style`, `url`, `type`, and at least one of `label` or `emoji`.\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setActions([\n\t * {\n\t * style: 'LINK',\n\t * label: 'Sapphire Website',\n\t * emoji: '🔷',\n\t * url: 'https://sapphirejs.dev',\n\t * type: ComponentType.Button\n\t * }\n\t * ], true);\n\t * ```\n\t *\n\t * @remark You can add custom Select Menus by providing `customId`, `type`, and `run`.\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setActions([\n\t * {\n\t * customId: 'custom_menu',\n\t * type: ComponentType.StringSelect,\n\t * run: (context) => console.log(context) // Do something here\n\t * }\n\t * ], true);\n\t * ```\n\t */\n\tpublic setActions(actions: PaginatedMessageAction[], includeDefaultActions = false): this {\n\t\tthis.actions.clear();\n\t\treturn this.addActions([...(includeDefaultActions ? PaginatedMessage.defaultActions : []), ...actions]);\n\t}\n\n\t/**\n\t * Adds actions to the existing ones. The order given is the order they will be used.\n\t * @param actions The actions to add.\n\t * @see {@link PaginatedMessage.setActions} for examples on how to structure the actions.\n\t */\n\tpublic addActions(actions: PaginatedMessageAction[]): this {\n\t\tfor (const action of actions) this.addAction(action);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds an action to the existing ones. This will be added as the last action.\n\t * @param action The action to add.\n\t * @see {@link PaginatedMessage.setActions} for examples on how to structure the action.\n\t */\n\tpublic addAction(action: PaginatedMessageAction): this {\n\t\tif (actionIsLinkButton(action)) {\n\t\t\tthis.actions.set(action.url, action);\n\t\t} else if (actionIsButtonOrMenu(action)) {\n\t\t\tthis.actions.set(action.customId, action);\n\t\t}\n\n\t\treturn this;\n\t}\n\t// #endregion\n\n\t// #region page related methods\n\t/**\n\t * Checks whether or not the handler has a specific page.\n\t * @param index The index to check.\n\t */\n\tpublic hasPage(index: number): boolean {\n\t\treturn index >= 0 && index < this.pages.length;\n\t}\n\n\t/**\n\t * Clears all current pages and messages and sets them. The order given is the order they will be used.\n\t * @param pages The pages to set.\n\t */\n\tpublic setPages(pages: PaginatedMessagePage[]) {\n\t\tthis.pages = [];\n\t\tthis.messages = [];\n\t\tthis.addPages(pages);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a page to the existing ones. This will be added as the last page.\n\t * @remark While you can use this method you should first check out\n\t * {@link PaginatedMessage.addPageBuilder},\n\t * {@link PaginatedMessage.addPageContent} and\n\t * {@link PaginatedMessage.addPageEmbed} as\n\t * these are easier functional methods of adding pages and will likely already suffice for your needs.\n\t *\n\t * @param page The page to add.\n\t */\n\tpublic addPage(page: PaginatedMessagePage): this {\n\t\t// Do not allow more than 25 pages, and send a warning when people try to do so.\n\t\tif (this.pages.length === 25) {\n\t\t\tif (!this.hasEmittedMaxPageWarning) {\n\t\t\t\tprocess.emitWarning(\n\t\t\t\t\t'Maximum amount of pages exceeded for PaginatedMessage. Please check your instance of PaginatedMessage and ensure that you do not exceed 25 pages total.',\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'PaginatedMessageExceededMessagePageAmount',\n\t\t\t\t\t\tcode: 'PAGINATED_MESSAGE_EXCEEDED_MAXIMUM_AMOUNT_OF_PAGES',\n\t\t\t\t\t\tdetail: `If you do need more than 25 pages you can extend the class and overwrite the actions in the constructor.`\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tthis.hasEmittedMaxPageWarning = true;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.pages.push(page);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Update the current page.\n\t * @param page The content to update the page with.\n\t *\n\t * @remark This method can only be used after {@link PaginatedMessage.run} has been used.\n\t */\n\tpublic async updateCurrentPage(page: PaginatedMessagePage): Promise<this> {\n\t\tconst interaction = this.response;\n\t\tconst currentIndex = this.index;\n\n\t\tif (interaction === null) {\n\t\t\tthrow new Error('You cannot update a page before responding to the interaction.');\n\t\t}\n\n\t\tthis.pages[currentIndex] = page;\n\t\tthis.messages[currentIndex] = null;\n\t\tthis.pageActions[currentIndex]?.clear();\n\n\t\tconst target = isAnyInteraction(interaction) ? interaction.user : interaction.author;\n\t\tawait this.resolvePage(interaction, target, currentIndex);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a page to the existing ones using a {@link MessageBuilder}. This will be added as the last page.\n\t * @param builder Either a callback whose first parameter is `new MessageBuilder()`, or an already constructed {@link MessageBuilder}\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t * const { EmbedBuilder } = require('discord.js');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageBuilder((builder) => {\n\t * \t\tconst embed = new EmbedBuilder()\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription('example description');\n\t *\n\t * \t\treturn builder\n\t * \t\t\t.setContent('example content')\n\t * \t\t\t.setEmbeds([embed]);\n\t * });\n\t * ```\n\t * @example\n\t * ```typescript\n\t * const { EmbedBuilder } = require('discord.js');\n\t * const { MessageBuilder, PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const embed = new EmbedBuilder()\n\t * \t.setColor('#FF0000')\n\t * \t.setDescription('example description');\n\t *\n\t * const builder = new MessageBuilder()\n\t * \t.setContent('example content')\n\t * \t.setEmbeds([embed]);\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageBuilder(builder);\n\t * ```\n\t */\n\tpublic addPageBuilder(builder: MessageBuilder | ((builder: MessageBuilder) => MessageBuilder)): this {\n\t\treturn this.addPage(isFunction(builder) ? builder(new MessageBuilder()) : builder);\n\t}\n\n\t/**\n\t * Adds a page to the existing ones asynchronously using a {@link MessageBuilder}. This wil be added as the last page.\n\t * @param builder Either a callback whose first parameter is `new MessageBuilder()`, or an already constructed {@link MessageBuilder}\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t * const { EmbedBuilder } = require('discord.js');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addAsyncPageBuilder(async (builder) => {\n\t * \t\tconst someRemoteData = await fetch('https://contoso.com/api/users');\n\t *\n\t * \t\tconst embed = new EmbedBuilder()\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription(someRemoteData.data);\n\t *\n\t * \t\treturn builder\n\t * \t\t\t.setContent('example content')\n\t * \t\t\t.setEmbeds([embed]);\n\t * });\n\t * ```\n\t */\n\tpublic addAsyncPageBuilder(builder: MessageBuilder | ((builder: MessageBuilder) => Promise<MessageBuilder>)): this {\n\t\treturn this.addPage(async () => (isFunction(builder) ? builder(new MessageBuilder()) : builder));\n\t}\n\n\t/**\n\t * Adds a page to the existing ones using simple message content. This will be added as the last page.\n\t * @param content The content to set.\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageContent('example content');\n\t * ```\n\t */\n\tpublic addPageContent(content: string): this {\n\t\treturn this.addPage({ content });\n\t}\n\n\t/**\n\t * Adds a page to the existing ones using a {@link EmbedBuilder}. This wil be added as the last page.\n\t * @param embed Either a callback whose first parameter is `new EmbedBuilder()`, or an already constructed {@link EmbedBuilder}\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageEmbed((embed) => {\n\t * \t\tembed\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription('example description');\n\t *\n\t * \t\treturn embed;\n\t * });\n\t * ```\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const embed = new EmbedBuilder()\n\t * \t.setColor('#FF0000')\n\t * \t.setDescription('example description');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageEmbed(embed);\n\t * ```\n\t */\n\tpublic addPageEmbed(embed: EmbedResolvable | ((embed: EmbedBuilder) => EmbedResolvable)): this {\n\t\treturn this.addPage({ embeds: isFunction(embed) ? [embed(new EmbedBuilder())] : [embed] });\n\t}\n\n\t/**\n\t * Adds a page to the existing ones asynchronously using a {@link EmbedBuilder}. This wil be added as the last page.\n\t * @param embed Either a callback whose first parameter is `new EmbedBuilder()`, or an already constructed {@link EmbedBuilder}\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addAsyncPageEmbed(async (embed) => {\n\t *\t\tconst someRemoteData = await fetch('https://contoso.com/api/users');\n\t *\n\t * \t\tembed\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription(someRemoteData.data);\n\t *\n\t * \t\treturn embed;\n\t * });\n\t * ```\n\t */\n\tpublic addAsyncPageEmbed(embed: EmbedResolvable | ((builder: EmbedBuilder) => Awaitable<EmbedResolvable>)): this {\n\t\treturn this.addPage(async () => ({ embeds: isFunction(embed) ? [await embed(new EmbedBuilder())] : [embed] }));\n\t}\n\n\t/**\n\t * Adds a page to the existing ones asynchronously using multiple {@link EmbedBuilder}'s. This wil be added as the last page.\n\t * @remark When using this with a callback this will construct 10 {@link EmbedBuilder}'s in the callback parameters, regardless of how many are actually used.\n\t * If this a performance impact you do not want to cope with then it is recommended to use {@link PaginatedMessage.addPageBuilder} instead, which will let you add\n\t * as many embeds as you want, albeit manually\n\t * @param embeds Either a callback which receives 10 parameters of `new EmbedBuilder()`, or an array of already constructed {@link EmbedBuilder}'s\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageEmbeds((embed1, embed2, embed3) => { // You can add up to 10 embeds\n\t * \t\tembed1\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription('example description 1');\n\t *\n\t * \t\tembed2\n\t * \t\t\t.setColor('#00FF00')\n\t * \t\t\t.setDescription('example description 2');\n\t *\n\t * \t\tembed3\n\t * \t\t\t.setColor('#0000FF')\n\t * \t\t\t.setDescription('example description 3');\n\t *\n\t * \t\treturn [embed1, embed2, embed3];\n\t * });\n\t * ```\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const embed1 = new EmbedBuilder()\n\t * \t.setColor('#FF0000')\n\t * \t.setDescription('example description 1');\n\t *\n\t * const embed2 = new EmbedBuilder()\n\t * \t.setColor('#00FF00')\n\t * \t.setDescription('example description 2');\n\t *\n\t * const embed3 = new EmbedBuilder()\n\t * \t.setColor('#0000FF')\n\t * \t.setDescription('example description 3');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageEmbeds([embed1, embed2, embed3]); // You can add up to 10 embeds\n\t * ```\n\t */\n\tpublic addPageEmbeds(\n\t\tembeds:\n\t\t\t| EmbedResolvable[]\n\t\t\t| ((\n\t\t\t\t\tembed1: EmbedBuilder,\n\t\t\t\t\tembed2: EmbedBuilder,\n\t\t\t\t\tembed3: EmbedBuilder,\n\t\t\t\t\tembed4: EmbedBuilder,\n\t\t\t\t\tembed5: EmbedBuilder,\n\t\t\t\t\tembed6: EmbedBuilder,\n\t\t\t\t\tembed7: EmbedBuilder,\n\t\t\t\t\tembed8: EmbedBuilder,\n\t\t\t\t\tembed9: EmbedBuilder,\n\t\t\t\t\tembed10: EmbedBuilder\n\t\t\t ) => EmbedResolvable[])\n\t): this {\n\t\tlet processedEmbeds = isFunction(embeds)\n\t\t\t? embeds(\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder()\n\t\t\t\t)\n\t\t\t: embeds;\n\n\t\tif (processedEmbeds.length > 10) {\n\t\t\tprocessedEmbeds = processedEmbeds.slice(0, 10);\n\t\t}\n\n\t\treturn this.addPage({ embeds: processedEmbeds });\n\t}\n\n\t/**\n\t * Adds a page to the existing ones using multiple {@link EmbedBuilder}'s. This wil be added as the last page.\n\t * @remark When using this with a callback this will construct 10 {@link EmbedBuilder}'s in the callback parameters, regardless of how many are actually used.\n\t * If this a performance impact you do not want to cope with then it is recommended to use {@link PaginatedMessage.addPageBuilder} instead, which will let you add\n\t * as many embeds as you want, albeit manually\n\t * @param embeds Either a callback which receives 10 parameters of `new EmbedBuilder()`, or an array of already constructed {@link EmbedBuilder}'s\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage().addAsyncPageEmbeds(async (embed0, embed1, embed2) => {\n\t * \tconst someRemoteData = (await fetch('https://contoso.com/api/users')) as any;\n\t *\n\t * \tfor (const [index, user] of Object.entries(someRemoteData.users.slice(0, 10)) as [`${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}`, any][]) {\n\t * \t\tswitch (index) {\n\t * \t\t\tcase '0': {\n\t * \t\t\t\tembed0.setColor('#FF0000').setDescription('example description 1').setAuthor(user.name);\n\t * \t\t\t\tbreak;\n\t * \t\t\t}\n\t * \t\t\tcase '1': {\n\t * \t\t\t\tembed1.setColor('#00FF00').setDescription('example description 2').setAuthor(user.name);\n\t * \t\t\t\tbreak;\n\t * \t\t\t}\n\t * \t\t\tcase '2': {\n\t * \t\t\t\tembed2.setColor('#0000FF').setDescription('example description 3').setAuthor(user.name);\n\t * \t\t\t\tbreak;\n\t * \t\t\t}\n\t * \t\t}\n\t * \t}\n\t *\n\t * \treturn [embed0, embed1, embed2];\n\t * });\n\t * ```\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const embed1 = new EmbedBuilder()\n\t * \t.setColor('#FF0000')\n\t * \t.setDescription('example description 1');\n\t *\n\t * const embed2 = new EmbedBuilder()\n\t * \t.setColor('#00FF00')\n\t * \t.setDescription('example description 2');\n\t *\n\t * const embed3 = new EmbedBuilder()\n\t * \t.setColor('#0000FF')\n\t * \t.setDescription('example description 3');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addAsyncPageEmbeds([embed1, embed2, embed3]); // You can add up to 10 embeds\n\t * ```\n\t */\n\tpublic addAsyncPageEmbeds(\n\t\tembeds:\n\t\t\t| EmbedResolvable[]\n\t\t\t| ((\n\t\t\t\t\tembed1: EmbedBuilder,\n\t\t\t\t\tembed2: EmbedBuilder,\n\t\t\t\t\tembed3: EmbedBuilder,\n\t\t\t\t\tembed4: EmbedBuilder,\n\t\t\t\t\tembed5: EmbedBuilder,\n\t\t\t\t\tembed6: EmbedBuilder,\n\t\t\t\t\tembed7: EmbedBuilder,\n\t\t\t\t\tembed8: EmbedBuilder,\n\t\t\t\t\tembed9: EmbedBuilder,\n\t\t\t\t\tembed10: EmbedBuilder\n\t\t\t ) => Awaitable<EmbedResolvable[]>)\n\t): this {\n\t\treturn this.addPage(async () => {\n\t\t\tlet processedEmbeds = isFunction(embeds)\n\t\t\t\t? await embeds(\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder()\n\t\t\t\t\t)\n\t\t\t\t: embeds;\n\n\t\t\tif (processedEmbeds.length > 10) {\n\t\t\t\tprocessedEmbeds = processedEmbeds.slice(0, 10);\n\t\t\t}\n\n\t\t\treturn { embeds: processedEmbeds };\n\t\t});\n\t}\n\n\t/**\n\t * Add pages to the existing ones. The order given is the order they will be used.\n\t * @param pages The pages to add.\n\t */\n\tpublic addPages(pages: PaginatedMessagePage[]): this {\n\t\tfor (const page of pages) this.addPage(page);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Clear all actions for a page and set the new ones.\n\t * @param actions The actions to set.\n\t * @param index The index of the page to set the actions to. **This is 0-based**.\n\t *\n\t * @remark Internally we check if the provided index exists.\n\t * This means that calling this function _before_ calling any of the methods below this will not work as the amount of pages will always be 0,\n\t * thus the index will always be out of bounds. That said, make sure you first define your pages and _then_ define your actions for those pages.\n\t * - {@link PaginatedMessage.addAsyncPageEmbed}\n\t * - {@link PaginatedMessage.addPageBuilder}\n\t * - {@link PaginatedMessage.addPageContent}\n\t * - {@link PaginatedMessage.addPageEmbed}\n\t * - {@link PaginatedMessage.addPageEmbeds}\n\t * - {@link PaginatedMessage.addPages}\n\t * - {@link PaginatedMessage.setPages}\n\t *\n\t * @remark Add a select menu to the first page, while preserving all default actions:\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setPageActions([\n\t * {\n\t * customId: 'custom_menu',\n\t * type: ComponentType.StringSelect,\n\t * run: (context) => console.log(context) // Do something here\n\t * }\n\t * ], 0);\n\t * ```\n\t * @see {@link PaginatedMessage.setActions} for more examples on how to structure the action.\n\t */\n\tpublic setPageActions(actions: PaginatedMessageAction[], index: number): this {\n\t\tif (index < 0 || index > this.pages.length - 1) throw new Error('Provided index is out of bounds');\n\n\t\tthis.pageActions[index]?.clear();\n\t\tthis.addPageActions(actions, index);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Add the provided actions to a page.\n\t * @param actions The actions to add.\n\t * @param index The index of the page to add the actions to.\n\t * @see {@link PaginatedMessage.setActions} for examples on how to structure the actions.\n\t *\n\t * @remark Internally we check if the provided index exists.\n\t * This means that calling this function _before_ calling any of the methods below this will not work as the amount of pages will always be 0,\n\t * thus the index will always be out of bounds. That said, make sure you first define your pages and _then_ define your actions for those pages.\n\t * - {@link PaginatedMessage.addAsyncPageEmbed}\n\t * - {@link PaginatedMessage.addPageBuilder}\n\t * - {@link PaginatedMessage.addPageContent}\n\t * - {@link PaginatedMessage.addPageEmbed}\n\t * - {@link PaginatedMessage.addPageEmbeds}\n\t * - {@link PaginatedMessage.addPages}\n\t * - {@link PaginatedMessage.setPages}\n\t */\n\tpublic addPageActions(actions: PaginatedMessageAction[], index: number): this {\n\t\tif (index < 0 || index > this.pages.length - 1) throw new Error('Provided index is out of bounds');\n\n\t\tfor (const action of actions) {\n\t\t\tthis.addPageAction(action, index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Add the provided action to a page.\n\t * @param action The action to add.\n\t * @param index The index of the page to add the action to.\n\t * @see {@link PaginatedMessage.setActions} for examples on how to structure the action.\n\t *\n\t * @remark Internally we check if the provided index exists.\n\t * This means that calling this function _before_ calling any of the methods below this will not work as the amount of pages will always be 0,\n\t * thus the index will always be out of bounds. That said, make sure you first define your pages and _then_ define your actions for those pages.\n\t * - {@link PaginatedMessage.addAsyncPageEmbed}\n\t * - {@link PaginatedMessage.addPageBuilder}\n\t * - {@link PaginatedMessage.addPageContent}\n\t * - {@link PaginatedMessage.addPageEmbed}\n\t * - {@link PaginatedMessage.addPageEmbeds}\n\t * - {@link PaginatedMessage.addPages}\n\t * - {@link PaginatedMessage.setPages}\n\t */\n\tpublic addPageAction(action: PaginatedMessageAction, index: number): this {\n\t\tif (index < 0 || index > this.pages.length - 1) throw new Error('Provided index is out of bounds');\n\n\t\tconst pageActionAtIndex = this.pageActions[index] ?? new Map<string, PaginatedMessageAction>();\n\n\t\tif (actionIsLinkButton(action)) {\n\t\t\tpageActionAtIndex.set(action.url, action);\n\t\t} else if (actionIsButtonOrMenu(action)) {\n\t\t\tpageActionAtIndex.set(action.customId, action);\n\t\t}\n\n\t\tthis.pageActions[index] = pageActionAtIndex;\n\n\t\treturn this;\n\t}\n\t// #endregion\n\n\t/**\n\t * Executes the {@link PaginatedMessage} and sends the pages corresponding with {@link PaginatedMessage.index}.\n\t * The handler will start collecting message component interactions.\n\t *\n\t * @remark Please note that for {@link PaginatedMessage} to work in DMs to your client, you need to add the `'CHANNEL'` partial to your `client.options.partials`.\n\t * Message based commands can always be used in DMs, whereas Chat Input interactions can only be used in DMs when they are registered globally.\n\t *\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * Generally this will be the command message or an interaction\n\t * (either a {@link CommandInteraction}, {@link ContextMenuInteraction}, or an interaction from {@link PaginatedMessageInteractionUnion}),\n\t * but it can also be another message from your client, i.e. to indicate a loading state.\n\t *\n\t * @param target The user who will be able to interact with the buttons of this {@link PaginatedMessage}.\n\t * If `messageOrInteraction` is an instance of {@link Message} then this defaults to {@link Message.author messageOrInteraction.author},\n\t * and if it is an instance of {@link CommandInteraction} then it defaults to {@link CommandInteraction.user messageOrInteraction.user}.\n\t */\n\tpublic async run(messageOrInteraction: Message | AnyInteractableInteraction, target?: User): Promise<this> {\n\t\t// If there is no channel then exit early and potentially emit a warning\n\t\tif (!messageOrInteraction.channel) {\n\t\t\tconst isInteraction = isAnyInteraction(messageOrInteraction);\n\t\t\tlet shouldEmitWarning = this.emitPartialDMChannelWarning;\n\n\t\t\t// If we are to emit a warning,\n\t\t\t// then check if a warning was already emitted,\n\t\t\t// in which case we don't want to emit a warning.\n\t\t\tif (shouldEmitWarning && this.hasEmittedPartialDMChannelWarning) {\n\t\t\t\tshouldEmitWarning = false;\n\t\t\t}\n\n\t\t\t// If we are to emit a warning,\n\t\t\t// then check if the interaction is an interaction based command,\n\t\t\t// and check if the client has the Partials.Channel partial,\n\t\t\t// in which case we don't want to emit a warning.\n\t\t\tif (shouldEmitWarning && isInteraction && messageOrInteraction.client.options.partials?.includes(Partials.Channel)) {\n\t\t\t\tshouldEmitWarning = false;\n\t\t\t}\n\n\t\t\t// IF we are to emit a warning,\n\t\t\t// then check if the interaction is a message based command,\n\t\t\t// and check if the client has the Partials.Channel partial,\n\t\t\t// and check if the client has the 'DIRECT_MESSAGE' intent',\n\t\t\t// in which case we don't want to emit a warning.\n\t\t\tif (\n\t\t\t\tshouldEmitWarning &&\n\t\t\t\t!isInteraction &&\n\t\t\t\tmessageOrInteraction.client.options.partials?.includes(Partials.Channel) &&\n\t\t\t\tnew IntentsBitField(messageOrInteraction.client.options.intents).has(GatewayIntentBits.DirectMessages)\n\t\t\t) {\n\t\t\t\tshouldEmitWarning = false;\n\t\t\t}\n\n\t\t\t// If we should emit a warning then do so.\n\t\t\tif (shouldEmitWarning) {\n\t\t\t\tprocess.emitWarning(\n\t\t\t\t\t[\n\t\t\t\t\t\t'PaginatedMessage was initiated in a DM channel without the client having the required partial configured.',\n\t\t\t\t\t\t'If you want PaginatedMessage to work in DM channels then make sure you start your client with \"CHANNEL\" added to \"client.options.partials\".',\n\t\t\t\t\t\t'Furthermore if you are using message based commands (as opposed to application commands) then you will also need to add the \"DIRECT_MESSAGE\" intent to \"client.options.intents\"',\n\t\t\t\t\t\t'If you do not want to be alerted about this in the future then you can disable this warning by setting \"PaginatedMessage.emitPartialDMChannelWarning\" to \"false\", or use \"setEmitPartialDMChannelWarning(false)\" before calling \"run\".'\n\t\t\t\t\t].join('\\n'),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'PaginatedMessageRunsInNonpartialDMChannel',\n\t\t\t\t\t\tcode: 'PAGINATED_MESSAGE_RUNS_IN_NON_PARTIAL_DM_CHANNEL'\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tthis.hasEmittedPartialDMChannelWarning = true;\n\t\t\t}\n\n\t\t\tawait safelyReplyToInteraction({\n\t\t\t\tmessageOrInteraction,\n\t\t\t\tinteractionEditReplyContent: this.#thisMazeWasNotMeantForYouContent,\n\t\t\t\tinteractionReplyContent: { ...this.#thisMazeWasNotMeantForYouContent, flags: MessageFlags.Ephemeral },\n\t\t\t\tcomponentUpdateContent: this.#thisMazeWasNotMeantForYouContent,\n\t\t\t\tmessageMethod: 'reply',\n\t\t\t\tmessageMethodContent: this.#thisMazeWasNotMeantForYouContent\n\t\t\t});\n\n\t\t\treturn this;\n\t\t}\n\n\t\t// Assign the target based on whether a Message or CommandInteraction was passed in\n\t\ttarget ??= isAnyInteraction(messageOrInteraction) ? messageOrInteraction.user : messageOrInteraction.author;\n\n\t\t// Try to get the previous PaginatedMessage for this user\n\t\tconst paginatedMessage = PaginatedMessage.handlers.get(target.id);\n\n\t\t// If a PaginatedMessage was found then stop it\n\t\tpaginatedMessage?.collector?.stop();\n\n\t\t// If the message was sent by a bot, then set the response as this one\n\t\tif (isAnyInteraction(messageOrInteraction)) {\n\t\t\tif (messageOrInteraction.user.bot && messageOrInteraction.user.id === messageOrInteraction.client.user?.id) {\n\t\t\t\tthis.response = messageOrInteraction;\n\t\t\t}\n\t\t} else if (messageOrInteraction.author.bot && messageOrInteraction.author.id === messageOrInteraction.client.user?.id) {\n\t\t\tthis.response = messageOrInteraction;\n\t\t}\n\n\t\tawait this.resolvePagesOnRun(messageOrInteraction, target);\n\n\t\t// Sanity checks to handle\n\t\tif (!this.messages.length) throw new Error('There are no messages.');\n\t\tif (!this.actions.size && !this.pageActions.length) throw new Error('There are no actions nor page actions.');\n\n\t\tawait this.setUpMessage(messageOrInteraction);\n\t\tthis.setUpCollector(messageOrInteraction, target);\n\n\t\tconst messageId = this.response!.id;\n\n\t\tif (this.collector) {\n\t\t\tthis.collector.once('end', () => {\n\t\t\t\tPaginatedMessage.messages.delete(messageId);\n\t\t\t\tPaginatedMessage.handlers.delete(target.id);\n\t\t\t});\n\n\t\t\tPaginatedMessage.messages.set(messageId, this);\n\t\t\tPaginatedMessage.handlers.set(target.id, this);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Executed whenever {@link PaginatedMessage.run} is called.\n\t */\n\tpublic async resolvePagesOnRun(messageOrInteraction: Message | AnyInteractableInteraction, target: User): Promise<void> {\n\t\tfor (let i = 0; i < this.pages.length; i++) {\n\t\t\tawait this.resolvePage(messageOrInteraction, target, i);\n\t\t}\n\t}\n\n\t/**\n\t * Executed whenever an action is triggered and resolved.\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * @param target The user who will be able to interact with the buttons of this {@link PaginatedMessage}.\n\t * @param index The index to resolve.\n\t */\n\tpublic async resolvePage(\n\t\tmessageOrInteraction: Message | AnyInteractableInteraction,\n\t\ttarget: User,\n\t\tindex: number\n\t): Promise<PaginatedMessageResolvedPage> {\n\t\t// If the message was already processed, do not load it again:\n\t\tconst message = this.messages[index];\n\t\tif (!isNullish(message)) {\n\t\t\treturn message;\n\t\t}\n\n\t\t// Load the page and return it:\n\t\tconst resolvedPage = await this.handlePageLoad(this.pages[index], index);\n\t\tif (resolvedPage.actions) {\n\t\t\tthis.addPageActions(resolvedPage.actions, index);\n\t\t}\n\n\t\tconst pageSpecificActions = this.pageActions.at(index);\n\t\tconst resolvedComponents: PaginatedMessageComponentUnion[] = [];\n\n\t\tif (this.pages.length > 1) {\n\t\t\tconst sharedActions = await this.handleActionLoad([...this.actions.values()], messageOrInteraction, target);\n\t\t\tconst sharedComponents = createPartitionedMessageRow(sharedActions);\n\n\t\t\tresolvedComponents.push(...sharedComponents);\n\t\t}\n\n\t\tif (pageSpecificActions) {\n\t\t\tconst pageActions = await this.handleActionLoad([...pageSpecificActions.values()], messageOrInteraction, target);\n\t\t\tconst pageComponents = createPartitionedMessageRow(pageActions);\n\n\t\t\tresolvedComponents.push(...pageComponents);\n\t\t}\n\n\t\tconst resolved = { ...resolvedPage, components: resolvedComponents };\n\t\tthis.messages[index] = resolved;\n\n\t\treturn resolved;\n\t}\n\n\t/**\n\t * Clones the current handler into a new instance.\n\t */\n\tpublic clone(): PaginatedMessage {\n\t\tconst clone = new this.constructor({ pages: this.pages, actions: [] }).setIndex(this.index).setIdle(this.idle);\n\t\tclone.actions = this.actions;\n\t\tclone.pageActions = this.pageActions;\n\t\tclone.response = this.response;\n\t\tclone.template = this.template;\n\t\treturn clone;\n\t}\n\n\t/**\n\t * Get the options of a page.\n\t * @param index The index of the page.\n\t */\n\tpublic async getPageOptions(index: number): Promise<PaginatedMessageMessageOptionsUnion | undefined> {\n\t\tconst page = this.pages.at(index);\n\t\treturn isFunction(page) ? page(index, this.pages, this) : page;\n\t}\n\n\t/**\n\t * Sets up the message.\n\t *\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * Generally this will be the command message or an interaction\n\t * (either a {@link CommandInteraction}, {@link ContextMenuInteraction}, or an interaction from {@link PaginatedMessageInteractionUnion}),\n\t * but it can also be another message from your client, i.e. to indicate a loading state.\n\t */\n\tprotected async setUpMessage(messageOrInteraction: Message | AnyInteractableInteraction): Promise<void> {\n\t\t// Get the current page\n\t\tlet page = this.messages[this.index]!;\n\n\t\t// Merge in the advanced options\n\t\tpage = { ...page, ...(this.paginatedMessageData ?? {}) };\n\n\t\tif (this.response) {\n\t\t\tif (isAnyInteraction(this.response)) {\n\t\t\t\tif (this.response.replied || this.response.deferred) {\n\t\t\t\t\tawait this.response.editReply(page);\n\t\t\t\t} else {\n\t\t\t\t\tawait this.response.reply({ ...page, content: page.content ?? undefined });\n\t\t\t\t}\n\t\t\t} else if (isMessageInstance(this.response)) {\n\t\t\t\tawait this.response.edit(page);\n\t\t\t}\n\t\t} else if (isAnyInteraction(messageOrInteraction)) {\n\t\t\tif (messageOrInteraction.replied || messageOrInteraction.deferred) {\n\t\t\t\tconst editReplyResponse = await messageOrInteraction.editReply(page);\n\t\t\t\tthis.response = messageOrInteraction.ephemeral ? messageOrInteraction : editReplyResponse;\n\t\t\t} else {\n\t\t\t\tthis.response = await messageOrInteraction.reply({\n\t\t\t\t\t...page,\n\t\t\t\t\tcontent: page.content ?? undefined,\n\t\t\t\t\tfetchReply: true,\n\t\t\t\t\tephemeral: false\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (isTextBasedChannel(messageOrInteraction.channel)) {\n\t\t\tthis.response = await messageOrInteraction.channel.send({ ...page, content: page.content ?? undefined });\n\t\t}\n\t}\n\n\t/**\n\t * Sets up the message's collector.\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * @param targetUser The user the handler is for.\n\t */\n\tprotected setUpCollector(messageOrInteraction: Message<boolean> | AnyInteractableInteraction, targetUser: User): void {\n\t\tif (this.pages.length > 1) {\n\t\t\tthis.collector = new InteractionCollector<PaginatedMessageInteractionUnion>(targetUser.client, {\n\t\t\t\tfilter: (interaction) => {\n\t\t\t\t\tif (!isNullish(this.response) && interaction.isMessageComponent()) {\n\t\t\t\t\t\tconst customIdValidation =\n\t\t\t\t\t\t\tthis.actions.has(interaction.customId) || this.pageActions.some((actions) => actions?.has(interaction.customId));\n\n\t\t\t\t\t\tif (isAnyInteraction(messageOrInteraction) && messageOrInteraction.ephemeral) {\n\t\t\t\t\t\t\treturn interaction.user.id === targetUser.id && customIdValidation;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn customIdValidation;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\n\t\t\t\ttime: this.idle,\n\n\t\t\t\tguild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild : undefined,\n\n\t\t\t\tchannel: messageOrInteraction.channel as Message['channel'],\n\n\t\t\t\tinteractionType: InteractionType.MessageComponent,\n\n\t\t\t\t...(!isNullish(this.response) && !isAnyInteraction(this.response)\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tmessage: this.response\n\t\t\t\t\t\t}\n\t\t\t\t\t: {})\n\t\t\t})\n\t\t\t\t.on('collect', this.handleCollect.bind(this, targetUser, messageOrInteraction.channel as Message['channel']))\n\t\t\t\t.on('end', this.handleEnd.bind(this));\n\t\t}\n\t}\n\n\t/**\n\t * Handles the load of a page.\n\t * @param page The page to be loaded.\n\t * @param index The index of the current page.\n\t */\n\tprotected async handlePageLoad(page: PaginatedMessagePage, index: number): Promise<PaginatedMessageMessageOptionsUnion> {\n\t\t// Resolve the options from a function or an object\n\t\tconst options = isFunction(page) ? await page(index, this.pages, this) : page;\n\n\t\t// Clone the template to leave the original intact\n\t\tconst clonedTemplate = deepClone(this.template);\n\n\t\t// Apply the template to the page\n\t\tconst optionsWithTemplate = this.applyTemplate(clonedTemplate, options);\n\n\t\t// Apply the footer to the embed, if any\n\t\treturn this.applyFooter(optionsWithTemplate, index);\n\t}\n\n\t/**\n\t * Handles the loading of actions.\n\t * @param actions The actions to be loaded.\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * @param targetUser The user the handler is for.\n\t */\n\tprotected async handleActionLoad(\n\t\tactions: PaginatedMessageAction[],\n\t\tmessageOrInteraction: Message | AnyInteractableInteraction,\n\t\ttargetUser: User\n\t): Promise<MessageActionRowComponentBuilder[]> {\n\t\treturn Promise.all(\n\t\t\tactions.map<Promise<MessageActionRowComponentBuilder>>(async (interaction) => {\n\t\t\t\tif (isMessageButtonInteractionData(interaction)) {\n\t\t\t\t\treturn new ButtonBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageUserSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new UserSelectMenuBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageRoleSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new RoleSelectMenuBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageMentionableSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new MentionableSelectMenuBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageChannelSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new ChannelSelectMenuBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageStringSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new StringSelectMenuBuilder({\n\t\t\t\t\t\t...interaction,\n\t\t\t\t\t\t...(interaction.customId === '@sapphire/paginated-messages.goToPage' && {\n\t\t\t\t\t\t\toptions: await Promise.all(\n\t\t\t\t\t\t\t\tthis.pages.map(async (_, index) => {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t...(await this.selectMenuOptions(\n\t\t\t\t\t\t\t\t\t\t\tindex + 1,\n\t\t\t\t\t\t\t\t\t\t\tthis.resolvePaginatedMessageInternationalizationContext(messageOrInteraction, targetUser)\n\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\tvalue: index.toString()\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tplaceholder: this.selectMenuPlaceholder\n\t\t\t\t\t\t})\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Unsupported message component type detected. Validate your code and if you're sure this is a bug in Sapphire make a report in the server\"\n\t\t\t\t);\n\t\t\t})\n\t\t);\n\t}\n\n\t/**\n\t * Handles the `collect` event from the collector.\n\t * @param targetUser The user the handler is for.\n\t * @param channel The channel the handler is running at.\n\t * @param interaction The button interaction that was received.\n\t */\n\tprotected async handleCollect(targetUser: User, channel: Message['channel'], interaction: PaginatedMessageInteractionUnion): Promise<void> {\n\t\tif (interaction.user.id === targetUser.id) {\n\t\t\t// Update the response to the latest interaction\n\t\t\tthis.response = interaction;\n\n\t\t\tconst action = this.getAction(interaction.customId, this.index);\n\t\t\tif (isNullish(action)) {\n\t\t\t\tthrow new Error('There was no action for the provided custom ID');\n\t\t\t}\n\n\t\t\tif (actionIsButtonOrMenu(action) && action.run) {\n\t\t\t\tconst previousIndex = this.index;\n\n\t\t\t\tawait action.run({\n\t\t\t\t\tinteraction,\n\t\t\t\t\thandler: this,\n\t\t\t\t\tauthor: targetUser,\n\t\t\t\t\tchannel,\n\t\t\t\t\tresponse: this.response,\n\t\t\t\t\tcollector: this.collector!\n\t\t\t\t});\n\n\t\t\t\tif (!this.stopPaginatedMessageCustomIds.includes(action.customId)) {\n\t\t\t\t\tconst newIndex = previousIndex === this.index ? previousIndex : this.index;\n\t\t\t\t\tconst updateOptions = await this.resolvePage(this.response, targetUser, newIndex);\n\n\t\t\t\t\tawait safelyReplyToInteraction({\n\t\t\t\t\t\tmessageOrInteraction: interaction,\n\t\t\t\t\t\tinteractionEditReplyContent: updateOptions,\n\t\t\t\t\t\tinteractionReplyContent: { ...this.#thisMazeWasNotMeantForYouContent, flags: MessageFlags.Ephemeral },\n\t\t\t\t\t\tcomponentUpdateContent: updateOptions\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst interactionReplyOptions = await this.wrongUserInteractionReply(\n\t\t\t\ttargetUser,\n\t\t\t\tinteraction.user,\n\t\t\t\tthis.resolvePaginatedMessageInternationalizationContext(interaction, targetUser)\n\t\t\t);\n\n\t\t\tawait interaction.reply(\n\t\t\t\tisObject(interactionReplyOptions)\n\t\t\t\t\t? interactionReplyOptions\n\t\t\t\t\t: { content: interactionReplyOptions, flags: MessageFlags.Ephemeral, allowedMentions: { users: [], roles: [] } }\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `end` event from the collector.\n\t * @param reason The reason for which the collector was ended.\n\t */\n\tprotected async handleEnd(_: Collection<Snowflake, PaginatedMessageInteractionUnion>, reason: PaginatedMessageStopReasons): Promise<void> {\n\t\t// Ensure no race condition can occur where interacting with the message when the paginated message closes would otherwise result in a DiscordAPIError\n\t\tif (\n\t\t\t(reason === 'time' || reason === 'idle') &&\n\t\t\tthis.response !== null &&\n\t\t\tisAnyInteraction(this.response) &&\n\t\t\tthis.response.isMessageComponent()\n\t\t) {\n\t\t\tthis.response.message = await this.response.fetchReply();\n\t\t}\n\n\t\t// Remove all listeners from the collector:\n\t\tthis.collector?.removeAllListeners();\n\n\t\t// Do not remove components if the message, channel, or guild, was deleted:\n\t\tif (this.response && !PaginatedMessage.deletionStopReasons.includes(reason)) {\n\t\t\tvoid safelyReplyToInteraction({\n\t\t\t\tmessageOrInteraction: this.response,\n\t\t\t\tinteractionEditReplyContent: { components: [] },\n\t\t\t\tinteractionReplyContent: { ...this.#thisMazeWasNotMeantForYouContent, flags: MessageFlags.Ephemeral },\n\t\t\t\tcomponentUpdateContent: { components: [] },\n\t\t\t\tmessageMethod: 'edit',\n\t\t\t\tmessageMethodContent: { components: [] }\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Applies footer to the last embed of the page\n\t * @param message The message options\n\t * @param index The current index\n\t * @returns The message options with the footer applied\n\t */\n\tprotected applyFooter(message: PaginatedMessageMessageOptionsUnion, index: number): PaginatedMessageMessageOptionsUnion {\n\t\tif (!message.embeds?.length) {\n\t\t\treturn message;\n\t\t}\n\n\t\tconst embedsWithFooterApplied = deepClone(message.embeds) as PaginatedMessageWriteableEmbedResolvable;\n\n\t\tconst idx = embedsWithFooterApplied.length - 1;\n\t\tif (embedsWithFooterApplied.length > 0) {\n\t\t\tlet lastEmbed = embedsWithFooterApplied[idx];\n\t\t\tconst templateEmbed = this.template.embeds?.[idx] ?? this.template.embeds?.[0];\n\t\t\tconst jsonTemplateEmbed = isJSONEncodable(templateEmbed) ? templateEmbed.toJSON() : templateEmbed;\n\n\t\t\tif (isJSONEncodable(lastEmbed)) {\n\t\t\t\tlastEmbed = lastEmbed.toJSON();\n\t\t\t\tembedsWithFooterApplied[idx] = lastEmbed;\n\t\t\t}\n\n\t\t\tlastEmbed.footer ??= { text: jsonTemplateEmbed?.footer?.text ?? '' };\n\n\t\t\tif (this.shouldAddFooterToEmbeds) {\n\t\t\t\tlastEmbed.footer.text = `${this.pageIndexPrefix ? `${this.pageIndexPrefix} ` : ''}${index + 1} / ${this.pages.length}${\n\t\t\t\t\tlastEmbed.footer.text ? ` ${this.embedFooterSeparator} ${lastEmbed.footer.text}` : ''\n\t\t\t\t}`;\n\t\t\t}\n\t\t}\n\n\t\treturn { ...message, embeds: embedsWithFooterApplied };\n\t}\n\n\t/**\n\t * Constructs a {@link PaginatedMessageInternationalizationContext}\n\t * @param messageOrInteraction The message or interaction for which the {@link PaginatedMessageInternationalizationContext} should be resolved.\n\t * @param targetUser The target user for whom this interaction is\n\t * @returns A constructed {@link PaginatedMessageInternationalizationContext}\n\t */\n\tprotected resolvePaginatedMessageInternationalizationContext(\n\t\tmessageOrInteraction: Message | AnyInteractableInteraction,\n\t\ttargetUser: User\n\t): PaginatedMessageInternationalizationContext {\n\t\tconst context: PaginatedMessageInternationalizationContext = {\n\t\t\tuser: targetUser,\n\t\t\tchannel: messageOrInteraction.channel,\n\t\t\tguild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild : null,\n\t\t\tinteractionGuildLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.guildLocale : undefined,\n\t\t\tinteractionLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.locale : undefined\n\t\t};\n\n\t\treturn context;\n\t}\n\n\t/**\n\t * Applies a template to the provided options, merging them together and applying the template's embeds.\n\t *\n\t * @param template - The template to apply.\n\t * @param options - The options to merge with the template.\n\t * @returns The merged options with the template's embeds applied.\n\t */\n\tprivate applyTemplate(\n\t\ttemplate: PaginatedMessageMessageOptionsUnion,\n\t\toptions: PaginatedMessageMessageOptionsUnion\n\t): PaginatedMessageMessageOptionsUnion {\n\t\tconst embedData = this.applyTemplateEmbed(template.embeds, options.embeds);\n\n\t\treturn { ...template, ...options, embeds: embedData };\n\t}\n\n\t/**\n\t * Applies a template embed to the page embeds.\n\t * If the page embeds are nullish, it returns the template embed as an array.\n\t * If the template embed is nullish, it returns the page embeds.\n\t * Otherwise, it merges the template embed with the first page embed.\n\t *\n\t * @param templateEmbed - The template embed to apply.\n\t * @param pageEmbeds - The page embeds to apply the template to.\n\t * @returns The resulting embeds after applying the template.\n\t */\n\tprivate applyTemplateEmbed(\n\t\ttemplateEmbed: PaginatedMessageEmbedResolvable,\n\t\tpageEmbeds: PaginatedMessageEmbedResolvable\n\t): PaginatedMessageEmbedResolvable {\n\t\tif (isNullish(pageEmbeds)) {\n\t\t\treturn templateEmbed ? [templateEmbed?.[0]] : undefined;\n\t\t}\n\n\t\tif (isNullish(templateEmbed)) {\n\t\t\treturn pageEmbeds;\n\t\t}\n\n\t\treturn this.mergeEmbeds(templateEmbed[0], pageEmbeds);\n\t}\n\n\t/**\n\t * Merges the template embed with an array of page embeds.\n\t *\n\t * @param templateEmbed - The template embed to merge.\n\t * @param pageEmbeds - The array of page embeds to merge.\n\t * @returns The merged embeds.\n\t */\n\tprivate mergeEmbeds(\n\t\ttemplateEmbed: Exclude<PaginatedMessageEmbedResolvable, undefined>[0],\n\t\tpageEmbeds: Exclude<PaginatedMessageEmbedResolvable, undefined>\n\t): Exclude<PaginatedMessageEmbedResolvable, undefined> {\n\t\tconst mergedEmbeds: PaginatedMessageWriteableEmbedResolvable = [];\n\n\t\tconst jsonTemplate = isJSONEncodable(templateEmbed) ? templateEmbed.toJSON() : templateEmbed;\n\n\t\tfor (const pageEmbed of pageEmbeds) {\n\t\t\tconst pageJson = isJSONEncodable(pageEmbed) ? pageEmbed.toJSON() : pageEmbed;\n\n\t\t\tmergedEmbeds.push({\n\t\t\t\ttitle: pageJson.title ?? jsonTemplate.title ?? undefined,\n\t\t\t\tdescription: pageJson.description ?? jsonTemplate.description ?? undefined,\n\t\t\t\turl: pageJson.url ?? jsonTemplate.url ?? undefined,\n\t\t\t\ttimestamp:\n\t\t\t\t\t(typeof pageJson.timestamp === 'string' ? new Date(pageJson.timestamp).toISOString() : pageJson.timestamp) ??\n\t\t\t\t\t(typeof jsonTemplate.timestamp === 'string' ? new Date(jsonTemplate.timestamp).toISOString() : jsonTemplate.timestamp) ??\n\t\t\t\t\tundefined,\n\t\t\t\tcolor: pageJson.color ?? jsonTemplate.color ?? undefined,\n\t\t\t\tfields: this.mergeArrays(jsonTemplate.fields, pageJson.fields),\n\t\t\t\tauthor: pageJson.author ?? jsonTemplate.author ?? undefined,\n\t\t\t\tthumbnail: pageJson.thumbnail ?? jsonTemplate.thumbnail ?? undefined,\n\t\t\t\timage: pageJson.image ?? jsonTemplate.image ?? undefined,\n\t\t\t\tvideo: pageJson.video ?? jsonTemplate.video ?? undefined,\n\t\t\t\tfooter: pageJson.footer ?? jsonTemplate.footer ?? undefined\n\t\t\t});\n\t\t}\n\n\t\treturn mergedEmbeds;\n\t}\n\n\t/**\n\t * Merges two arrays together.\n\t * @template T - The type of elements in the arrays.\n\t * @param {T[]} template - The first array to merge.\n\t * @param {T[]} array - The second array to merge.\n\t * @returns {undefined | T[]} - The merged array or undefined if both arrays are nullish.\n\t */\n\tprivate mergeArrays<T>(template?: T[], array?: T[]): undefined | T[] {\n\t\tif (isNullish(array)) {\n\t\t\treturn template;\n\t\t}\n\n\t\tif (isNullish(template)) {\n\t\t\treturn array;\n\t\t}\n\n\t\treturn [...template, ...array];\n\t}\n\n\t/**\n\t * Retrieves the PaginatedMessageAction associated with the provided customId and index.\n\t *\n\t * @param customId - The customId of the action.\n\t * @param index - The index of the action in the pageActions array.\n\t * @returns The PaginatedMessageAction associated with the customId and index, or undefined if not found.\n\t */\n\tprivate getAction(customId: string, index: number): PaginatedMessageAction | undefined {\n\t\tconst action = this.actions.get(customId);\n\t\tif (action) return action;\n\t\treturn this.pageActions.at(index)?.get(customId);\n\t}\n}\n\n/**\n * The `PaginatedMessage` interface represents a paginated message.\n */\nexport interface PaginatedMessage {\n\t/**\n\t * The `constructor` field represents the constructor of the `PaginatedMessage` interface.\n\t * It is of type `typeof PaginatedMessage`, which means it refers to the type of the `PaginatedMessage` interface itself.\n\t */\n\tconstructor: typeof PaginatedMessage;\n}\n","import { isFunction } from '@sapphire/utilities';\nimport { EmbedBuilder, Message, User } from 'discord.js';\nimport { MessageBuilder } from '../builders/MessageBuilder';\nimport type { AnyInteractableInteraction } from '../utility-types';\nimport { PaginatedMessage } from './PaginatedMessage';\nimport type { EmbedResolvable, PaginatedMessageResolvedPage } from './PaginatedMessageTypes';\n\n/**\n * This is a LazyPaginatedMessage. Instead of resolving all pages that are functions on {@link PaginatedMessage.run} will resolve when requested.\n */\nexport class LazyPaginatedMessage extends PaginatedMessage {\n\t/**\n\t * Only resolves the page corresponding with the handler's current index.\n\t */\n\tpublic override async resolvePagesOnRun(messageOrInteraction: Message | AnyInteractableInteraction, target: User): Promise<void> {\n\t\tawait this.resolvePage(messageOrInteraction, target, this.index);\n\t}\n\n\t/**\n\t * Resolves the page corresponding with the given index. This also resolves the index's before and after the given index.\n\t * @param messageOrInteraction The message or interaction that triggered this {@link LazyPaginatedMessage}.\n\t * @param target The user who will be able to interact with the buttons of this {@link LazyPaginatedMessage}.\n\t * @param index The index to resolve. Defaults to handler's current index.\n\t */\n\tpublic override async resolvePage(\n\t\tmessageOrInteraction: Message | AnyInteractableInteraction,\n\t\ttarget: User,\n\t\tindex: number\n\t): Promise<PaginatedMessageResolvedPage> {\n\t\tconst promises = [super.resolvePage(messageOrInteraction, target, index)];\n\t\tif (this.hasPage(index - 1)) promises.push(super.resolvePage(messageOrInteraction, target, index - 1));\n\t\tif (this.hasPage(index + 1)) promises.push(super.resolvePage(messageOrInteraction, target, index + 1));\n\n\t\tconst [result] = await Promise.all(promises);\n\t\treturn result;\n\t}\n\n\tpublic override addPageBuilder(builder: MessageBuilder | ((builder: MessageBuilder) => MessageBuilder)): this {\n\t\treturn this.addPage(() => (isFunction(builder) ? builder(new MessageBuilder()) : builder));\n\t}\n\n\tpublic override addPageContent(content: string): this {\n\t\treturn this.addPage(() => ({ content }));\n\t}\n\n\tpublic override addPageEmbed(embed: EmbedResolvable | ((builder: EmbedBuilder) => EmbedResolvable)): this {\n\t\treturn this.addPage(() => ({ embeds: typeof embed === 'function' ? [embed(new EmbedBuilder())] : [embed] }));\n\t}\n\n\tpublic override addPageEmbeds(\n\t\tembeds:\n\t\t\t| EmbedResolvable[]\n\t\t\t| ((\n\t\t\t\t\tembed1: EmbedBuilder,\n\t\t\t\t\tembed2: EmbedBuilder,\n\t\t\t\t\tembed3: EmbedBuilder,\n\t\t\t\t\tembed4: EmbedBuilder,\n\t\t\t\t\tembed5: EmbedBuilder,\n\t\t\t\t\tembed6: EmbedBuilder,\n\t\t\t\t\tembed7: EmbedBuilder,\n\t\t\t\t\tembed8: EmbedBuilder,\n\t\t\t\t\tembed9: EmbedBuilder,\n\t\t\t\t\tembed10: EmbedBuilder\n\t\t\t ) => EmbedResolvable[])\n\t): this {\n\t\treturn this.addPage(() => {\n\t\t\tlet processedEmbeds = isFunction(embeds)\n\t\t\t\t? embeds(\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder()\n\t\t\t\t\t)\n\t\t\t\t: embeds;\n\n\t\t\tif (processedEmbeds.length > 10) {\n\t\t\t\tprocessedEmbeds = processedEmbeds.slice(0, 10);\n\t\t\t}\n\n\t\t\treturn { embeds: processedEmbeds };\n\t\t});\n\t}\n}\n","import { isFunction, isNullish, isNullishOrEmpty } from '@sapphire/utilities';\nimport { EmbedBuilder, isJSONEncodable, type APIEmbed, type EmbedData } from 'discord.js';\nimport { PaginatedMessage } from './PaginatedMessage';\nimport type { EmbedResolvable } from './PaginatedMessageTypes';\n\n/**\n * This is a utility of {@link PaginatedMessage}, except it exclusively adds pagination inside a field of an embed.\n * You must either use this class directly or extend it.\n *\n * It differs from PaginatedMessageEmbedFields as the items here are the shape you want, and are then concatenated\n * in a single field with a given formatter function, whereas PaginatedMessageEmbedFields takes fields as the items\n * and add them to the embed.\n *\n * @example\n * ```typescript\n * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n *\n * new PaginatedFieldMessageEmbed()\n * .setTitleField('Test pager field')\n * .setTemplate({ embed })\n * .setItems([\n * { title: 'Sapphire Framework', value: 'discord.js Framework' },\n * { title: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n * { title: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n * ])\n * .formatItems((item) => `${item.title}\\n${item.value}`)\n * .setItemsPerPage(2)\n * .make()\n * .run(message);\n * ```\n */\nexport class PaginatedFieldMessageEmbed<T> extends PaginatedMessage {\n\t/**\n\t * The `embedTemplate` field represents the template for the embed message. It is of type `APIEmbed`.\n\t * It is initialized with a new `EmbedBuilder` instance converted to JSON.\n\t */\n\tprivate embedTemplate: APIEmbed = new EmbedBuilder().toJSON();\n\n\t/**\n\t * The `totalPages` field represents the total number of pages in the paginated message. It is of type `number`.\n\t * It is initialized to 0.\n\t */\n\tprivate totalPages: number = 0;\n\n\t/**\n\t * The `items` field represents the items to be displayed in the paginated message. It is an array of type `T`.\n\t * It is initialized to an empty array.\n\t */\n\tprivate items: T[] = [];\n\n\t/**\n\t * The `itemsPerPage` field represents the number of items to be displayed per page. It is of type `number`.\n\t * It is initialized to 10.\n\t */\n\tprivate itemsPerPage: number = 10;\n\n\t/**\n\t * The `fieldTitle` field represents the title of the field in the embed message. It is of type `string`.\n\t * It is initialized to an empty string.\n\t */\n\tprivate fieldTitle: string = '';\n\n\t/**\n\t * Set the items to paginate.\n\t * @param items The pages to set\n\t */\n\tpublic setItems(items: T[]) {\n\t\tthis.items = items;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the title of the embed field that will be used to paginate the items.\n\t * @param title The field title\n\t */\n\tpublic setTitleField(title: string) {\n\t\tthis.fieldTitle = title;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the amount of items that should be shown per page.\n\t * @param itemsPerPage The number of items\n\t */\n\tpublic setItemsPerPage(itemsPerPage: number) {\n\t\tthis.itemsPerPage = itemsPerPage;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the template to be used to display the embed fields as pages. This template can either be set from a template {@link EmbedBuilder} instance or an object with embed options.\n\t *\n\t * @param template EmbedBuilder\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n\t * import { EmbedBuilder } from 'discord.js';\n\t *\n\t * new PaginatedFieldMessageEmbed().setTemplate(new EmbedBuilder().setTitle('Test pager embed')).make().run(message);\n\t * ```\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedFieldMessageEmbed().setTemplate({ title: 'Test pager embed' }).make().run(message);\n\t * ```\n\t */\n\tpublic setTemplate(template: EmbedData | EmbedResolvable | ((embed: EmbedBuilder) => EmbedResolvable)) {\n\t\tthis.embedTemplate = this.resolveTemplate(template);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets a format callback that will be mapped to each embed field in the array of items when the embed is paginated. This should convert each item to a format that is either text itself or can be serialized as text.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedFieldMessageEmbed()\n\t * .setTitleField('Test field')\n\t * .setTemplate({ embed })\n\t * .setItems([\n\t * { title: 'Sapphire Framework', value: 'discord.js Framework' },\n\t * { title: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n\t * { title: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n\t * ])\n\t * .formatItems((item) => `${item.title}\\n${item.value}`)\n\t * .make()\n\t * .run(message);\n\t * ```\n\t * @param formatter The formatter callback to be applied to each embed item\n\t */\n\tpublic formatItems(formatter: (item: T, index: number, array: T[]) => any) {\n\t\tthis.items = this.items.map(formatter);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Build the pages of the given array.\n\t *\n\t * You must call the {@link PaginatedFieldMessageEmbed.make} and {@link PaginatedFieldMessageEmbed.run} methods last, in that order, for the pagination to work.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedFieldMessageEmbed()\n\t * .setTitleField('Test field')\n\t * .setTemplate({ embed })\n\t * .setItems([\n\t * { title: 'Sapphire Framework', value: 'discord.js Framework' },\n\t * { title: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n\t * { title: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n\t * ])\n\t * .formatItems((item) => `${item.title}\\n${item.value}`)\n\t * .make()\n\t * .run(message);\n\t * ```\n\t */\n\tpublic make() {\n\t\tif (!this.fieldTitle.length) throw new Error('The title of the field to format must have a value.');\n\t\tif (!this.items.length) throw new Error('The items array is empty.');\n\t\tif (this.items.some((x) => !x)) throw new Error('The format of the array items is incorrect.');\n\n\t\tthis.totalPages = Math.ceil(this.items.length / this.itemsPerPage);\n\t\tthis.generatePages();\n\t\treturn this;\n\t}\n\n\t/**\n\t * Generates the pages for the paginated field message embed.\n\t * Each page contains a cloned template with modified fields and data.\n\t */\n\tprivate generatePages() {\n\t\tconst template = this.embedTemplate;\n\t\tfor (let i = 0; i < this.totalPages; i++) {\n\t\t\tconst clonedTemplate = new EmbedBuilder(template);\n\t\t\tconst fieldsClone = isNullishOrEmpty(template.fields) ? [] : [...template.fields];\n\t\t\tif (fieldsClone.length > 0) clonedTemplate.setFields();\n\t\t\tif (isNullish(template.color)) clonedTemplate.setColor('Random');\n\n\t\t\tconst data = this.paginateArray(this.items, i, this.itemsPerPage);\n\t\t\tthis.addPage({\n\t\t\t\tembeds: [clonedTemplate.addFields({ name: this.fieldTitle, value: data.join('\\n'), inline: false }, ...fieldsClone)]\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Paginates an array of items.\n\t *\n\t * @template T The type of items in the array.\n\t * @param items The array of items to paginate.\n\t * @param currentPage The current page number.\n\t * @param perPageItems The number of items per page.\n\t * @returns The paginated array of items.\n\t */\n\tprivate paginateArray(items: T[], currentPage: number, perPageItems: number) {\n\t\tconst offset = currentPage * perPageItems;\n\t\treturn items.slice(offset, offset + perPageItems);\n\t}\n\n\t/**\n\t * Resolves the template for the embed.\n\t *\n\t * @param template - The template for the embed. It can be an EmbedResolvable, EmbedData, or a function that takes an EmbedBuilder and returns an EmbedResolvable.\n\t * @returns The resolved APIEmbed object.\n\t */\n\tprivate resolveTemplate(template: EmbedResolvable | EmbedData | ((embed: EmbedBuilder) => EmbedResolvable)): APIEmbed {\n\t\tif (isFunction(template)) template = template(new EmbedBuilder());\n\t\treturn (isJSONEncodable(template) ? template : new EmbedBuilder(template)).toJSON();\n\t}\n}\n","import { EmbedLimits } from '@sapphire/discord-utilities';\nimport { isFunction, isNullishOrEmpty } from '@sapphire/utilities';\nimport { EmbedBuilder, isJSONEncodable, type APIEmbed, type EmbedData, type EmbedField } from 'discord.js';\nimport { PaginatedMessage } from './PaginatedMessage';\nimport type { EmbedResolvable } from './PaginatedMessageTypes';\n\n/**\n * This is a utility of {@link PaginatedMessage}, except it exclusively paginates the fields of an embed.\n * You must either use this class directly or extend it.\n *\n * It differs from PaginatedFieldMessageEmbed as the items here are whole fields, that are added to the embed,\n * whereas PaginatedFieldMessageEmbed concatenates the items in a single field with a given formatter function.\n *\n * @example\n * ```typescript\n * import { PaginatedMessageEmbedFields } from '@sapphire/discord.js-utilities';\n *\n * new PaginatedMessageEmbedFields()\n * \t.setTemplate({ title: 'Test pager embed', color: '#006080' })\n * \t.setItems([\n * \t\t{ name: 'Sapphire Framework', value: 'discord.js Framework' },\n * \t\t{ name: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n * \t\t{ name: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n * \t])\n * \t.setItemsPerPage(2)\n * \t.make()\n * \t.run(message);\n * ```\n */\nexport class PaginatedMessageEmbedFields extends PaginatedMessage {\n\t/**\n\t * The `embedTemplate` field represents the template for the embed message. It is of type `APIEmbed`.\n\t * It is initialized with a new `EmbedBuilder` instance converted to JSON.\n\t */\n\tprivate embedTemplate: APIEmbed = new EmbedBuilder().toJSON();\n\n\t/**\n\t * The `totalPages` field represents the total number of pages in the paginated message. It is of type `number`.\n\t * It is initialized to 0.\n\t */\n\tprivate totalPages: number = 0;\n\n\t/**\n\t * The array of embed fields in the PaginatedMessageEmbedFields class.\n\t */\n\tprivate items: EmbedField[] = [];\n\n\t/**\n\t * The `itemsPerPage` field represents the number of items to be displayed per page. It is of type `number`.\n\t * It is initialized to 10.\n\t */\n\tprivate itemsPerPage: number = 10;\n\n\t/**\n\t * Set the items to paginate.\n\t * @param items The pages to set\n\t */\n\tpublic setItems(items: EmbedField[]): this {\n\t\tthis.items = items;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the amount of items that should be shown per page.\n\t * @param itemsPerPage The number of items\n\t */\n\tpublic setItemsPerPage(itemsPerPage: number): this {\n\t\tthis.itemsPerPage = itemsPerPage;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the template to be used to display the embed fields as pages. This template can either be set from a template {@link MessageEmbed} instance or an object with embed options.\n\t * All fields in the given template will be overwritten when calling {@link PaginatedMessageEmbedFields.make}.\n\t *\n\t * @param template MessageEmbed\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessageEmbedFields } from '@sapphire/discord.js-utilities';\n\t * import { EmbedBuilder } from 'discord.js';\n\t *\n\t * new PaginatedMessageEmbedFields()\n\t * \t.setTemplate(new EmbedBuilder().setColor('#006080').setTitle('Test pager embed'))\n\t * \t.setItems([{ name: 'My field', value: 'The field\\'s value' }])\n\t * \t.make()\n\t * \t.run(message);\n\t * ```\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessageEmbedFields } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedMessageEmbedFields()\n\t * \t.setTemplate({ title: 'Test pager embed', color: '#006080' })\n\t * \t.setItems([{ name: 'My field', value: 'The field\\'s value' }])\n\t * \t.make()\n\t * \t.run(message);\n\t * ```\n\t */\n\tpublic setTemplate(template: EmbedResolvable | ((embed: EmbedBuilder) => EmbedResolvable)): this {\n\t\tthis.embedTemplate = this.resolveTemplate(template);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Build the pages of the given array.\n\t *\n\t * You must call the [[PaginatedMessageEmbedFields.make]] and [[PaginatedMessageEmbedFields.run]] methods last, in that order, for the pagination to work.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessageEmbedFields } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedMessageEmbedFields()\n\t * \t.setItems([\n\t * \t\t{ name: 'Sapphire Framework', value: 'discord.js Framework' },\n\t * \t\t{ name: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n\t * \t\t{ name: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n\t * \t])\n\t * \t.setItemsPerPage(3)\n\t * \t.make()\n\t * \t.run(message);\n\t * ```\n\t */\n\tpublic make(): this {\n\t\tif (!this.items.length) throw new Error('The items array is empty.');\n\t\tif (this.itemsPerPage > EmbedLimits.MaximumFields) throw new Error(`Pages cannot contain more than ${EmbedLimits.MaximumFields} fields.`);\n\n\t\tthis.totalPages = Math.ceil(this.items.length / this.itemsPerPage);\n\t\tthis.generatePages();\n\t\treturn this;\n\t}\n\n\t/**\n\t * Generates the pages for the paginated message.\n\t * It clones the embed template, sets the fields, color, and adds the data to each page.\n\t */\n\tprivate generatePages(): void {\n\t\tconst template = this.embedTemplate;\n\t\tfor (let i = 0; i < this.totalPages; i++) {\n\t\t\tconst clonedTemplate = new EmbedBuilder(template);\n\t\t\tconst fieldsClone = isNullishOrEmpty(template.fields) ? [] : [...template.fields];\n\t\t\tif (fieldsClone.length > 0) clonedTemplate.setFields();\n\n\t\t\tif (!clonedTemplate.data.color) clonedTemplate.setColor('Random');\n\n\t\t\tconst data = this.paginateArray(this.items, i, this.itemsPerPage - fieldsClone.length);\n\t\t\tthis.addPage({\n\t\t\t\tembeds: [clonedTemplate.addFields(...data, ...fieldsClone)]\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Paginates an array of EmbedFields.\n\t *\n\t * @param items - The array of EmbedFields to paginate.\n\t * @param currentPage - The current page number.\n\t * @param perPageItems - The number of items per page.\n\t * @returns The paginated array of EmbedFields.\n\t */\n\tprivate paginateArray(items: EmbedField[], currentPage: number, perPageItems: number): EmbedField[] {\n\t\tconst offset = currentPage * perPageItems;\n\t\treturn items.slice(offset, offset + perPageItems);\n\t}\n\n\t/**\n\t * Resolves the template for the PaginatedMessageEmbedFields.\n\t *\n\t * @param template - The template to resolve. It can be an EmbedResolvable, EmbedData, or a function that takes an EmbedBuilder and returns an EmbedResolvable.\n\t * @returns The resolved APIEmbed object.\n\t */\n\tprivate resolveTemplate(template: EmbedResolvable | EmbedData | ((embed: EmbedBuilder) => EmbedResolvable)): APIEmbed {\n\t\tif (isFunction(template)) template = template(new EmbedBuilder());\n\t\treturn (isJSONEncodable(template) ? template : new EmbedBuilder(template)).toJSON();\n\t}\n}\n","import { isNullish, type Nullish } from '@sapphire/utilities';\nimport { PermissionFlagsBits, PermissionsBitField, type VoiceBasedChannel } from 'discord.js';\nimport { isDMChannel, isGuildBasedChannel, isVoiceBasedChannel } from './type-guards';\nimport type { ChannelTypes } from './utility-types';\n\nconst canReadMessagesPermissions = new PermissionsBitField([PermissionFlagsBits.ViewChannel]);\n\n/**\n * Determines whether or not we can read messages in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can read messages in the specified channel.\n */\nexport function canReadMessages(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\n\treturn canDoUtility(channel, canReadMessagesPermissions);\n}\n\nconst canSendMessagesPermissions = new PermissionsBitField([canReadMessagesPermissions, PermissionFlagsBits.SendMessages]);\n\n/**\n * Determines whether or not we can send messages in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can send messages in the specified channel.\n */\nexport function canSendMessages(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\tif (channel.isThread() && !channel.sendable) return false;\n\n\treturn canDoUtility(channel, canSendMessagesPermissions);\n}\n\nconst canSendEmbedsPermissions = new PermissionsBitField([canSendMessagesPermissions, PermissionFlagsBits.EmbedLinks]);\n\n/**\n * Determines whether or not we can send embeds in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can send embeds in the specified channel.\n */\nexport function canSendEmbeds(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\tif (channel.isThread() && !channel.sendable) return false;\n\n\treturn canDoUtility(channel, canSendEmbedsPermissions);\n}\n\nconst canSendAttachmentsPermissions = new PermissionsBitField([canSendMessagesPermissions, PermissionFlagsBits.AttachFiles]);\n\n/**\n * Determines whether or not we can send attachments in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can send attachments in the specified channel.\n */\nexport function canSendAttachments(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\tif (channel.isThread() && !channel.sendable) return false;\n\n\treturn canDoUtility(channel, canSendAttachmentsPermissions);\n}\n\nconst canReactPermissions = new PermissionsBitField([\n\tcanSendMessagesPermissions,\n\tPermissionFlagsBits.ReadMessageHistory,\n\tPermissionFlagsBits.AddReactions\n]);\n\n/**\n * Determines whether or not we can send react to messages in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can react to messages in the specified channel.\n */\nexport function canReact(channel: ChannelTypes | Nullish) {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\tif (channel.isThread() && channel.archived) return false;\n\n\treturn canDoUtility(channel, canReactPermissions);\n}\n\nconst canRemoveAllReactionsPermissions = new PermissionsBitField([\n\tcanReadMessagesPermissions,\n\tPermissionFlagsBits.ReadMessageHistory,\n\tPermissionFlagsBits.ManageMessages\n]);\n\n/**\n * Determines whether or not we can remove reactions from messages in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can remove reactions from messages in the specified channel.\n */\nexport function canRemoveAllReactions(channel: ChannelTypes | Nullish) {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return false;\n\n\treturn canDoUtility(channel, canRemoveAllReactionsPermissions);\n}\n\nconst canJoinVoiceChannelPermissions = new PermissionsBitField([PermissionFlagsBits.Connect]);\n\n/**\n * Determines whether the client can join the given voice based channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not the client can join the specified channel.\n */\nexport function canJoinVoiceChannel(channel: VoiceBasedChannel | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (!isVoiceBasedChannel(channel)) return false;\n\tif (channel.userLimit >= channel.members.size) return false;\n\n\treturn canDoUtility(channel, canJoinVoiceChannelPermissions);\n}\n\nfunction canDoUtility(channel: ChannelTypes, permissionsToPass: PermissionsBitField) {\n\tif (!isGuildBasedChannel(channel)) {\n\t\treturn true;\n\t}\n\n\tconst { me } = channel.guild.members;\n\tif (!me) return false;\n\n\tconst permissionsFor = channel.permissionsFor(me);\n\tif (!permissionsFor) return false;\n\n\treturn permissionsFor.has(permissionsToPass);\n}\n"]}
1
+ {"version":3,"sources":["../../src/lib/builders/MessageBuilder.ts","../../src/lib/type-guards.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterBaseStrategy.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterConfirmStrategy.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterMessageStrategy.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterNumberStrategy.ts","../../src/lib/MessagePrompter/strategies/MessagePrompterReactionStrategy.ts","../../src/lib/MessagePrompter/MessagePrompter.ts","../../src/lib/PaginatedMessages/utils.ts","../../src/lib/PaginatedMessages/PaginatedMessage.ts","../../src/lib/PaginatedMessages/LazyPaginatedMessage.ts","../../src/lib/PaginatedMessages/PaginatedFieldMessageEmbed.ts","../../src/lib/PaginatedMessages/PaginatedMessageEmbedFields.ts","../../src/lib/utilities.ts"],"names":["ChannelType","isNullish","Message","BaseInteraction","GuildMember","isNullishOrEmpty","isNullishOrZero","collected","reaction","ComponentType","ButtonStyle","partition","chunk","ActionRowBuilder","Time","isJSONEncodable","isFunction","EmbedBuilder","Partials","IntentsBitField","GatewayIntentBits","MessageFlags","InteractionCollector","InteractionType","deepClone","ButtonBuilder","UserSelectMenuBuilder","RoleSelectMenuBuilder","MentionableSelectMenuBuilder","ChannelSelectMenuBuilder","StringSelectMenuBuilder","isObject","userMention","EmbedLimits","PermissionsBitField","PermissionFlagsBits"],"mappings":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;AAC7B,EAAA,IAAI,CAAC,IAAI,OAAO,KAAA;AAEhB,EAAA,MAAM,cAAA,GAAiB,OAAA,CAAQ,cAAA,CAAe,EAAE,CAAA;AAChD,EAAA,IAAI,CAAC,gBAAgB,OAAO,KAAA;AAE5B,EAAA,OAAO,cAAA,CAAe,IAAI,iBAAiB,CAAA;AAC5C;AAZS,MAAA,CAAA,YAAA,EAAA,cAAA,CAAA","file":"index.cjs","sourcesContent":["import type { MessageCreateOptions } from 'discord.js';\n\nexport type MessageBuilderFileResolvable = NonNullable<MessageCreateOptions['files']>[number];\nexport type MessageBuilderResolvable = Omit<MessageCreateOptions, 'embed' | 'disableMentions' | 'reply'> & {\n\tembeds?: MessageCreateOptions['embeds'];\n\tcomponents?: MessageCreateOptions['components'];\n};\n\n/**\n * A message builder class, it implements the {@link MessageCreateOptions} interface.\n */\nexport class MessageBuilder implements MessageCreateOptions {\n\t/**\n\t * Whether or not the message should be spoken aloud.\n\t * @default false\n\t */\n\tpublic tts?: MessageCreateOptions['tts'];\n\n\t/**\n\t * The nonce for the message.\n\t * @default ''\n\t */\n\tpublic nonce?: MessageCreateOptions['nonce'];\n\n\t/**\n\t * The content for the message. If set to undefined and the builder is used to edit, the content will not be\n\t * replaced.\n\t */\n\tpublic content?: MessageCreateOptions['content'];\n\n\t/**\n\t * The embeds for the message. If set to undefined and the builder is used to edit, the embed will not be replaced.\n\t * @remark There is a maximum of 10 embeds in 1 message\n\t */\n\tpublic embeds?: MessageCreateOptions['embeds'];\n\n\t/**\n\t * The components for the message. If set to undefined and the builder is used to edit, the components will not be replaced.\n\t */\n\tpublic components?: MessageCreateOptions['components'];\n\n\t/**\n\t * Which mentions should be parsed from the message content.\n\t */\n\tpublic allowedMentions?: MessageCreateOptions['allowedMentions'];\n\n\t/**\n\t * Files to send with the message. This should not be set when editing a message, as Discord does not support\n\t * editing file attachments.\n\t */\n\tpublic files?: MessageCreateOptions['files'];\n\n\tpublic constructor(options?: MessageBuilderResolvable) {\n\t\tthis.tts = options?.tts ?? MessageBuilder.defaults.tts;\n\t\tthis.nonce = options?.nonce ?? MessageBuilder.defaults.nonce;\n\t\tthis.content = options?.content ?? MessageBuilder.defaults.content;\n\t\tthis.embeds = options?.embeds ?? MessageBuilder.defaults.embeds;\n\t\tthis.components = options?.components ?? MessageBuilder.defaults.components;\n\t\tthis.allowedMentions = options?.allowedMentions ?? MessageBuilder.defaults.allowedMentions;\n\t\tthis.files = options?.files ?? MessageBuilder.defaults.files;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.tts} field.\n\t * @param tts Whether or not the message should be spoken aloud.\n\t */\n\tpublic setTTS(tts?: boolean): this {\n\t\tthis.tts = tts;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.nonce} field.\n\t * @param nonce The nonce for the message.\n\t */\n\tpublic setNonce(nonce?: string): this {\n\t\tthis.nonce = nonce;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.content} field.\n\t * @param content The content for the message. If set to undefined and the builder is used to edit, the content will\n\t * not be replaced.\n\t */\n\tpublic setContent(content?: string): this {\n\t\tthis.content = content;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.embed} field.\n\t * @param embeds The embeds for the message. If set to undefined and the builder is used to edit, the embed will not be\n\t * replaced. There is a maximum of 10 embeds per message\n\t * @remark When providing more than 10 embeds, the array will automatically be sliced down to the first 10.\n\t */\n\tpublic setEmbeds(embeds?: MessageCreateOptions['embeds']): this {\n\t\t// Ensure no more than 10 embeds are ever set\n\t\tif (embeds && embeds.length > 10) {\n\t\t\tembeds = embeds.slice(0, 10);\n\t\t}\n\n\t\tthis.embeds = embeds;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.components} field.\n\t * @param components The components for the message. If set to undefined and the builder is used to edit, the components will\n\t * not be replaced.\n\t */\n\tpublic setComponents(components?: MessageCreateOptions['components']): this {\n\t\tthis.components = components;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.allowedMentions} field.\n\t * @param allowedMentions Which mentions should be parsed from the message content.\n\t */\n\tpublic setAllowedMentions(allowedMentions?: MessageCreateOptions['allowedMentions']): this {\n\t\tthis.allowedMentions = allowedMentions;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a new value for the {@link MessageBuilder.files} field array.\n\t * @param file The file to add to the {@link MessageBuilder.files} field array.\n\t */\n\tpublic addFile(file: MessageBuilderFileResolvable): this {\n\t\tthis.files = this.files?.concat(file) ?? [file];\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets a single value for the {@link MessageBuilder.files} field array.\n\t * @param file The file to send with the message. This should not be set when editing a message, as Discord does not\n\t * support editing file attachments.\n\t */\n\tpublic setFile(file: MessageBuilderFileResolvable): this {\n\t\tthis.files = [file];\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value for the {@link MessageBuilder.files} field.\n\t * @param files The files to send with the message. This should not be set when editing a message, as Discord does\n\t * not support editing file attachments.\n\t */\n\tpublic setFiles(files?: MessageBuilderFileResolvable[]): this {\n\t\tthis.files = files;\n\t\treturn this;\n\t}\n\n\t/**\n\t * The default values for all MessageBuilder instances.\n\t */\n\tpublic static defaults: MessageBuilderResolvable = {};\n}\n","import { isNullish, isNullishOrEmpty, isNullishOrZero, type Nullish } from '@sapphire/utilities';\nimport {\n\tBaseInteraction,\n\tChannelType,\n\tGuildMember,\n\tMessage,\n\ttype APIGuildMember,\n\ttype APIInteractionDataResolvedGuildMember,\n\ttype APIInteractionGuildMember,\n\ttype APIMessage,\n\ttype Attachment,\n\ttype CategoryChannel,\n\ttype Channel,\n\ttype DMChannel,\n\ttype Interaction,\n\ttype NewsChannel,\n\ttype PartialDMChannel,\n\ttype PartialGroupDMChannel,\n\ttype PrivateThreadChannel,\n\ttype PublicThreadChannel,\n\ttype StageChannel,\n\ttype TextChannel,\n\ttype ThreadChannel,\n\ttype VoiceBasedChannel,\n\ttype VoiceChannel\n} from 'discord.js';\nimport type {\n\tAnyInteractableInteraction,\n\tChannelTypes,\n\tGuildTextBasedChannelTypes,\n\tNonThreadGuildTextBasedChannelTypes,\n\tTextBasedChannelTypes\n} from './utility-types';\n\n/**\n * Checks whether a given channel is a {@link CategoryChannel}\n * This checks for {@link ChannelType.GuildCategory}.\n * @param channel The channel to check\n */\nexport function isCategoryChannel(channel: ChannelTypes | Nullish): channel is CategoryChannel {\n\treturn channel?.type === ChannelType.GuildCategory;\n}\n\n/**\n * Checks whether a given channel is a {@link DMChannel}\n * This checks for {@link ChannelType.DM}.\n * @param channel The channel to check\n */\nexport function isDMChannel(channel: ChannelTypes | Nullish): channel is DMChannel | PartialDMChannel {\n\treturn channel?.type === ChannelType.DM;\n}\n\n/**\n * Checks whether a given channel is a {@link PartialGroupDMChannel}\n * This checks for {@link ChannelType.GroupDM}.\n * @param channel The channel to check\n */\nexport function isGroupChannel(channel: Channel | PartialDMChannel | Nullish): channel is PartialGroupDMChannel {\n\treturn channel?.type === ChannelType.GroupDM;\n}\n\n/**\n * Checks if a channel comes from a guild.\n * This checks that the channel is **not** {@link ChannelType.DM}.\n * @param channel The channel to check\n * @returns Whether or not the channel is guild-based.\n */\nexport function isGuildBasedChannel(channel: ChannelTypes | Nullish): channel is GuildTextBasedChannelTypes {\n\treturn channel?.type !== ChannelType.DM;\n}\n\n/**\n * Checks whether or not a channel comes from a guild.\n * @remark As opposed to {@link isGuildBasedChannel} this checks if there is `guild` property on the channel.\n * @param channel The channel to check.\n * @returns Whether or not the channel is guild-based.\n */\nexport function isGuildBasedChannelByGuildKey(channel: ChannelTypes | Nullish): channel is GuildTextBasedChannelTypes {\n\treturn Reflect.has(channel ?? {}, 'guild');\n}\n\n/**\n * Checks whether a given channel is a {@link NewsChannel}.\n * This checks for {@link ChannelType.GuildAnnouncement}.\n * @param channel The channel to check.\n */\nexport function isNewsChannel(channel: ChannelTypes | Nullish): channel is NewsChannel {\n\treturn channel?.type === ChannelType.GuildAnnouncement;\n}\n\n/**\n * Checks whether a given channel is a {@link TextChannel}.\n * This checks for {@link ChannelType.GuildText}.\n * @param channel The channel to check.\n */\nexport function isTextChannel(channel: ChannelTypes | Nullish): channel is TextChannel {\n\treturn channel?.type === ChannelType.GuildText;\n}\n\n/**\n * Checks whether a given channel is a {@link VoiceChannel}\n * This checks for {@link ChannelType.GuildVoice}.\n * @param channel The channel to check\n */\nexport function isVoiceChannel(channel: ChannelTypes | Nullish): channel is VoiceChannel {\n\treturn channel?.type === ChannelType.GuildVoice;\n}\n\n/**\n * Checks whether a given channel is a {@link StageChannel}\n * This checks for {@link ChannelType.GuildStageVoice}.\n * @param channel The channel to check\n */\nexport function isStageChannel(channel: ChannelTypes | Nullish): channel is StageChannel {\n\treturn channel?.type === ChannelType.GuildStageVoice;\n}\n\n/**\n * Checks whether a given channel is a {@link ThreadChannel}\n * This checks for {@link ChannelTypes.isThread()}.\n * @param channel The channel to check.\n */\nexport function isThreadChannel(channel: ChannelTypes | Nullish): channel is ThreadChannel {\n\treturn channel?.isThread() ?? false;\n}\n\n/**\n * Checks whether a given channel is an Announcement {@link PublicThreadChannel}\n * This checks for {@link ChannelType.AnnouncementThread}.\n * @param channel The channel to check.\n */\nexport function isNewsThreadChannel(channel: ChannelTypes | Nullish): channel is PublicThreadChannel {\n\treturn channel?.type === ChannelType.AnnouncementThread;\n}\n\n/**\n * Checks whether a given channel is a {@link PublicThreadChannel}\n * This checks for {@link ChannelType.PublicThread}.\n * @param channel The channel to check.\n */\nexport function isPublicThreadChannel(channel: ChannelTypes | Nullish): channel is PublicThreadChannel {\n\treturn channel?.type === ChannelType.PublicThread;\n}\n\n/**\n * Checks whether a given channel is a {@link PrivateThreadChannel}\n * This checks for {@link ChannelType.PrivateThread}.\n * @param channel The channel to check.\n */\nexport function isPrivateThreadChannel(channel: ChannelTypes | Nullish): channel is PrivateThreadChannel {\n\treturn channel?.type === ChannelType.PrivateThread;\n}\n\n/**\n * Checks whether a given channel is a {@link TextBasedChannelTypes}. This means it has a `send` method.\n * @param channel The channel to check.\n */\nexport function isTextBasedChannel(channel: ChannelTypes | Nullish): channel is Exclude<TextBasedChannelTypes, StageChannel | PartialGroupDMChannel> {\n\tif (\n\t\tisNullish(channel) || //\n\t\tchannel.partial ||\n\t\tisGroupChannel(channel as Channel | PartialDMChannel | Nullish) ||\n\t\tisStageChannel(channel)\n\t) {\n\t\treturn false;\n\t}\n\n\t// eslint-disable-next-line @typescript-eslint/unbound-method\n\treturn !isNullish((channel as Exclude<TextBasedChannelTypes, StageChannel | PartialGroupDMChannel>).send);\n}\n\n/**\n * Checks whether a given channel is a {@link VoiceBasedChannel}.\n * This checks for {@link Channel.isVoiceBased()}.\n * @param channel - The channel to check.\n */\nexport function isVoiceBasedChannel(channel: Channel | Nullish): channel is VoiceBasedChannel {\n\tif (isNullish(channel)) return false;\n\n\treturn channel.isVoiceBased();\n}\n\n/**\n * Checks whether a given channel allows NSFW content or not\n *\n * For the following channel types this is always false:\n * - {@link ChannelType.DM}\n * - {@link ChannelType.GroupDM}\n * - {@link ChannelType.GuildCategory}\n * - {@link ChannelType.GuildStageVoice}\n * - {@link ChannelType.GuildVoice}\n * - {@link ChannelType.GuildDirectory}\n *\n * For the following channel types the actual channel is checked:\n * - {@link ChannelType.GuildAnnouncement}\n * - {@link ChannelType.GuildText}\n * - {@link ChannelType.GuildForum}\n *\n * For the following channel types the parent of the channel is checked:\n * - {@link ChannelType.AnnouncementThread}\n * - {@link ChannelType.PrivateThread}\n * - {@link ChannelType.PublicThread}\n * - {@link ChannelType.MediaChannel}\n * @param channel The channel to check.\n */\nexport function isNsfwChannel(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\n\tswitch (channel.type) {\n\t\tcase ChannelType.DM:\n\t\tcase ChannelType.GroupDM:\n\t\tcase ChannelType.GuildCategory:\n\t\tcase ChannelType.GuildStageVoice:\n\t\tcase ChannelType.GuildVoice:\n\t\tcase ChannelType.GuildDirectory:\n\t\t\treturn false;\n\t\tcase ChannelType.GuildAnnouncement:\n\t\tcase ChannelType.GuildText:\n\t\tcase ChannelType.GuildForum:\n\t\tcase ChannelType.GuildMedia:\n\t\t\treturn (channel as Exclude<NonThreadGuildTextBasedChannelTypes, VoiceChannel | StageChannel>).nsfw;\n\t\tcase ChannelType.AnnouncementThread:\n\t\tcase ChannelType.PrivateThread:\n\t\tcase ChannelType.PublicThread:\n\t\t\treturn Boolean((channel as ThreadChannel).parent?.nsfw);\n\t}\n}\n\n/**\n * Checks whether a given message is an instance of {@link Message}, and not {@link APIMessage}\n * @param message The message to check\n * @returns `true` if the message is an instance of `Message`, false otherwise.\n */\nexport function isMessageInstance(message: APIMessage | Message): message is Message {\n\treturn message instanceof Message;\n}\n\n/**\n * Checks whether the input `messageOrInteraction` is one of {@link Message} or any class that\n * extends {@link BaseInteraction}. This generally boils down to being one of:\n * - {@link Interaction}\n * - {@link AutocompleteInteraction}\n * - {@link ButtonInteraction}\n * - {@link ChannelSelectMenuInteraction}\n * - {@link ChatInputCommandInteraction}\n * - {@link CommandInteraction}\n * - {@link ContextMenuInteraction}\n * - {@link MentionableSelectMenuInteraction}\n * - {@link MessageComponentInteraction}\n * - {@link MessageContextMenuCommandInteraction}\n * - {@link ModalSubmitInteraction}\n * - {@link RoleSelectMenuInteraction}\n * - {@link SelectMenuInteraction}\n * - {@link StringSelectMenuInteraction}\n * - {@link UserContextMenuCommandInteraction}\n * - {@link UserSelectMenuInteraction}\n *\n * @param messageOrInteraction The message or interaction that should be checked.\n * @returns `true` if the `messageOrInteraction` is an instanceof {@link BaseInteraction}, `false` if it is not.\n */\nexport function isAnyInteraction(messageOrInteraction: APIMessage | Message | BaseInteraction): messageOrInteraction is BaseInteraction {\n\treturn messageOrInteraction instanceof BaseInteraction;\n}\n\n/**\n * Checks whether the input `messageOrInteraction` is one of {@link Message} or any class that extends {@link BaseInteraction}\n * As opposed to {@link isAnyInteraction} this also checks that the interaction can actually be interacted with by the user\n * which means that this **cannot** be an {@link AutocompleteInteraction}.\n * That said, this type guard filters the `messageOrInteraction` down to one of:\n * - {@link Interaction}\n * - {@link ButtonInteraction}\n * - {@link ChannelSelectMenuInteraction}\n * - {@link ChatInputCommandInteraction}\n * - {@link CommandInteraction}\n * - {@link ContextMenuInteraction}\n * - {@link MentionableSelectMenuInteraction}\n * - {@link MessageComponentInteraction}\n * - {@link MessageContextMenuCommandInteraction}\n * - {@link ModalSubmitInteraction}\n * - {@link RoleSelectMenuInteraction}\n * - {@link SelectMenuInteraction}\n * - {@link StringSelectMenuInteraction}\n * - {@link UserContextMenuCommandInteraction}\n * - {@link UserSelectMenuInteraction}\n *\n * @param messageOrInteraction The message or interaction that should be checked.\n * @returns `true` if the `messageOrInteraction` is an instanceof {@link BaseInteraction} and does **NOT** pass\n * {@link Interaction.isAutocomplete()}, `false` otherwise.\n */\nexport function isAnyInteractableInteraction(\n\tmessageOrInteraction: APIMessage | Message | BaseInteraction\n): messageOrInteraction is AnyInteractableInteraction {\n\tif (isAnyInteraction(messageOrInteraction)) {\n\t\treturn !messageOrInteraction.isAutocomplete();\n\t}\n\n\treturn false;\n}\n\n/**\n * Checks whether a given member is an instance of {@link GuildMember}, and not {@link APIInteractionGuildMember}, {@link APIGuildMember}, or {@link Nullish}\n * @param member The member to check\n * @returns `true` if the member is an instance of `GuildMember`, false otherwise.\n */\nexport function isGuildMember(\n\tmember: GuildMember | APIGuildMember | APIInteractionGuildMember | APIInteractionDataResolvedGuildMember | Nullish\n): member is GuildMember {\n\treturn member instanceof GuildMember;\n}\n\n/**\n * Checks whether an attachment is a media attachment, this is done so by checking the content type of the attachment,\n * if the content type starts with `image/`, `video/` or `audio/` it is considered a media attachment.\n *\n * If the content type is `image/` or `video/`, it will also check if the attachment has dimensions defined to ensure\n * it is a valid media attachment.\n *\n * @param attachment - The attachment to check\n * @returns Whether the attachment is a media attachment\n *\n * @since 7.3.0\n */\nexport function isMediaAttachment(attachment: Attachment): boolean {\n\tif (isNullishOrEmpty(attachment.contentType)) return false;\n\n\t// If the attachment is an audio attachment, return true:\n\tif (attachment.contentType.startsWith('audio/')) return true;\n\n\t// If the attachment is an image or video attachment, return true if it has dimensions defined:\n\treturn attachment.contentType.startsWith('image/') || attachment.contentType.startsWith('video/') //\n\t\t? hasDimensionsDefined(attachment)\n\t\t: false;\n}\n\n/**\n * Checks whether an attachment is an image attachment, this is done so by checking the content type of the attachment,\n * if the content type starts with `image/` and the attachment has dimensions defined, it is considered an image\n * attachment.\n *\n * @param attachment - The attachment to check\n * @returns Whether the attachment is an image attachment\n *\n * @since 7.3.0\n */\nexport function isImageAttachment(attachment: Attachment): boolean {\n\treturn (\n\t\t// A content type is required for an image attachment:\n\t\t!isNullishOrEmpty(attachment.contentType) && //\n\t\t// An image attachment must have a content type starting with 'image/':\n\t\tattachment.contentType.startsWith('image/') &&\n\t\t// An image attachment must have dimensions defined:\n\t\thasDimensionsDefined(attachment)\n\t);\n}\n\n/** @internal - function used by {@link isImageAttachment} and {@link isMediaAttachment} */\nfunction hasDimensionsDefined(attachment: Attachment): boolean {\n\treturn !isNullishOrZero(attachment.width) && !isNullishOrZero(attachment.height);\n}\n","import { isNullish, type ArgumentTypes, type Awaitable } from '@sapphire/utilities';\nimport type { CollectorFilter, CollectorOptions, EmojiIdentifierResolvable, Message, MessageReaction, User } from 'discord.js';\nimport { isStageChannel, isTextBasedChannel } from '../../type-guards';\nimport type { IMessagePrompterExplicitReturnBase } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterStrategyOptions } from '../strategyOptions';\n\nexport abstract class MessagePrompterBaseStrategy {\n\t/**\n\t * The type of strategy that was used\n\t */\n\tpublic type: string;\n\n\t/**\n\t * The timeout that was used in the collector\n\t */\n\tpublic timeout: number;\n\n\t/**\n\t * Whether to return an explicit object with data, or the strategies' default\n\t */\n\tpublic explicitReturn: boolean;\n\n\t/**\n\t * The message that has been sent in {@link MessagePrompter.run}\n\t */\n\tpublic appliedMessage: Message | null = null;\n\n\t/**\n\t * The message that will be sent in {@link MessagePrompter.run}\n\t */\n\tpublic message: MessagePrompterMessage;\n\n\t/**\n\t * The message the bot will edit to send its prompt in {@link MessagePrompter.run}\n\t */\n\tpublic editMessage: Message | undefined;\n\n\t/**\n\t * Constructor for the {@link MessagePrompterBaseStrategy} class\n\t * @param type - The type of message prompter strategy\n\t * @param message - The message that this prompt is for\n\t * @param options - Overrideable options if needed.\n\t */\n\tpublic constructor(type: string, message: MessagePrompterMessage, options?: IMessagePrompterStrategyOptions) {\n\t\tthis.type = type;\n\t\tthis.timeout = options?.timeout ?? MessagePrompterBaseStrategy.defaultStrategyOptions.timeout ?? 10 * 1000;\n\t\tthis.explicitReturn = options?.explicitReturn ?? MessagePrompterBaseStrategy.defaultStrategyOptions.explicitReturn ?? false;\n\t\tthis.editMessage = options?.editMessage ?? MessagePrompterBaseStrategy.defaultStrategyOptions.editMessage ?? undefined;\n\t\tthis.message = message;\n\t}\n\n\tpublic abstract run(channel: MessagePrompterChannelTypes, authorOrFilter: User | CollectorFilter<unknown[]>): Awaitable<unknown>;\n\n\tprotected async collectReactions(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>,\n\t\treactions: string[] | EmojiIdentifierResolvable[]\n\t): Promise<IMessagePrompterExplicitReturnBase> {\n\t\tif (isTextBasedChannel(channel) && !isStageChannel(channel)) {\n\t\t\tif (!isNullish(this.editMessage) && this.editMessage.editable) {\n\t\t\t\tthis.appliedMessage = await this.editMessage.edit(this.message as ArgumentTypes<Message['edit']>[0]);\n\t\t\t} else {\n\t\t\t\tthis.appliedMessage = await channel.send(this.message);\n\t\t\t}\n\n\t\t\tconst collector = this.appliedMessage.createReactionCollector({\n\t\t\t\t...this.createReactionPromptFilter(reactions, authorOrFilter),\n\t\t\t\tmax: 1,\n\t\t\t\ttime: this.timeout\n\t\t\t});\n\n\t\t\tlet resolved = false;\n\t\t\tconst collected: Promise<MessageReaction> = new Promise<MessageReaction>((resolve, reject) => {\n\t\t\t\tcollector.on('collect', (r) => {\n\t\t\t\t\tresolve(r);\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tcollector.stop();\n\t\t\t\t});\n\n\t\t\t\tcollector.on('end', (collected) => {\n\t\t\t\t\tresolved = true;\n\t\t\t\t\tif (!collected.size) reject(new Error('Collector has ended'));\n\t\t\t\t});\n\t\t\t});\n\n\t\t\tfor (const reaction of reactions) {\n\t\t\t\tif (resolved) break;\n\n\t\t\t\tawait this.appliedMessage.react(reaction);\n\t\t\t}\n\n\t\t\tconst firstReaction = await collected;\n\t\t\tconst emoji = firstReaction?.emoji;\n\n\t\t\tconst reaction = reactions.find((r) => (emoji?.id ?? emoji?.name) === r);\n\n\t\t\treturn {\n\t\t\t\temoji,\n\t\t\t\treaction,\n\t\t\t\tstrategy: this,\n\t\t\t\tappliedMessage: this.appliedMessage,\n\t\t\t\tmessage: this.message\n\t\t\t};\n\t\t}\n\n\t\tthrow new Error('A channel was provided to which I am not able to send messages');\n\t}\n\n\t/**\n\t * Creates a filter for the collector to filter on\n\t * @return The filter for awaitReactions function\n\t */\n\tprotected createReactionPromptFilter(\n\t\treactions: string[] | EmojiIdentifierResolvable[],\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>\n\t): CollectorOptions<[MessageReaction, User]> {\n\t\treturn {\n\t\t\tfilter: async (reaction: MessageReaction, user: User) =>\n\t\t\t\treactions.includes(reaction.emoji.id ?? reaction.emoji.name ?? '') &&\n\t\t\t\t(typeof authorOrFilter === 'function' ? await authorOrFilter(reaction, user) : user.id === authorOrFilter.id) &&\n\t\t\t\t!user.bot\n\t\t};\n\t}\n\n\t/**\n\t * The default strategy options\n\t */\n\tpublic static defaultStrategyOptions: IMessagePrompterStrategyOptions = {\n\t\ttimeout: 10 * 1000,\n\t\texplicitReturn: false,\n\t\teditMessage: undefined\n\t};\n}\n","import type { CollectorFilter, EmojiResolvable, MessageReaction, User } from 'discord.js';\nimport type { IMessagePrompterExplicitConfirmReturn } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterConfirmStrategyOptions } from '../strategyOptions';\nimport { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';\n\nexport class MessagePrompterConfirmStrategy extends MessagePrompterBaseStrategy implements IMessagePrompterConfirmStrategyOptions {\n\t/**\n\t * The confirm emoji used\n\t */\n\tpublic confirmEmoji: string | EmojiResolvable;\n\n\t/**\n\t * The cancel emoji used\n\t */\n\tpublic cancelEmoji: string | EmojiResolvable;\n\n\t/**\n\t * Constructor for the {@link MessagePrompterBaseStrategy} class\n\t * @param message The message to be sent {@link MessagePrompter}\n\t * @param options Overrideable options if needed.\n\t */\n\tpublic constructor(message: MessagePrompterMessage, options?: IMessagePrompterConfirmStrategyOptions) {\n\t\tsuper('confirm', message, options);\n\n\t\tthis.confirmEmoji = options?.confirmEmoji ?? MessagePrompterConfirmStrategy.confirmEmoji;\n\t\tthis.cancelEmoji = options?.cancelEmoji ?? MessagePrompterConfirmStrategy.cancelEmoji;\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals confirm.\n\t * The handler will wait for one (1) reaction.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t * @returns A promise that resolves to a boolean denoting the value of the input (`true` for yes, `false` for no).\n\t */\n\tpublic override async run(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>\n\t): Promise<IMessagePrompterExplicitConfirmReturn | boolean> {\n\t\tconst response = await this.collectReactions(channel, authorOrFilter, [this.confirmEmoji, this.cancelEmoji]);\n\n\t\tconst confirmed = (response?.emoji?.id ?? response?.emoji?.name) === this.confirmEmoji;\n\n\t\t// prettier-ignore\n\t\treturn this.explicitReturn ? { ...response, confirmed } : confirmed;\n\t}\n\n\t/**\n\t * The default confirm emoji used for {@link MessagePrompterConfirmStrategy}\n\t */\n\tpublic static confirmEmoji: string | EmojiResolvable = '🇾';\n\n\t/**\n\t * The default cancel emoji used for {@link MessagePrompterConfirmStrategy}\n\t */\n\tpublic static cancelEmoji: string | EmojiResolvable = '🇳';\n}\n","import { isNullish, type ArgumentTypes } from '@sapphire/utilities';\nimport type { CollectorFilter, CollectorOptions, Message, User } from 'discord.js';\nimport { isStageChannel, isTextBasedChannel } from '../../type-guards';\nimport type { IMessagePrompterExplicitMessageReturn } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterStrategyOptions } from '../strategyOptions';\nimport { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';\n\nexport class MessagePrompterMessageStrategy extends MessagePrompterBaseStrategy implements IMessagePrompterStrategyOptions {\n\t/**\n\t * Constructor for the {@link MessagePrompterBaseStrategy} class\n\t * @param message The message instance for this {@link MessagePrompter}\n\t * @param options Overrideable options if needed.\n\t */\n\tpublic constructor(message: MessagePrompterMessage, options: IMessagePrompterStrategyOptions) {\n\t\tsuper('message', message, options);\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals message.\n\t * The handler will wait for one (1) message.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t * @returns A promise that resolves to the message object received.\n\t */\n\tpublic override async run(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[Message]>\n\t): Promise<IMessagePrompterExplicitMessageReturn | Message> {\n\t\tif (isTextBasedChannel(channel) && !isStageChannel(channel)) {\n\t\t\tif (!isNullish(this.editMessage) && this.editMessage.editable) {\n\t\t\t\tthis.appliedMessage = await this.editMessage.edit(this.message as ArgumentTypes<Message['edit']>[0]);\n\t\t\t} else {\n\t\t\t\tthis.appliedMessage = await channel.send(this.message);\n\t\t\t}\n\n\t\t\tconst collector = await channel.awaitMessages({\n\t\t\t\t...this.createMessagePromptFilter(authorOrFilter),\n\t\t\t\tmax: 1,\n\t\t\t\ttime: this.timeout,\n\t\t\t\terrors: ['time']\n\t\t\t});\n\t\t\tconst response = collector.first();\n\n\t\t\tif (!response) {\n\t\t\t\tthrow new Error('No messages received');\n\t\t\t}\n\n\t\t\treturn this.explicitReturn\n\t\t\t\t? {\n\t\t\t\t\t\tresponse,\n\t\t\t\t\t\tstrategy: this,\n\t\t\t\t\t\tappliedMessage: this.appliedMessage,\n\t\t\t\t\t\tmessage: this.message\n\t\t\t\t\t}\n\t\t\t\t: response;\n\t\t}\n\n\t\tthrow new Error('A channel was provided to which I am not able to send messages');\n\t}\n\n\t/**\n\t * Creates a filter for the collector to filter on\n\t * @return The filter for awaitMessages function\n\t */\n\tprivate createMessagePromptFilter(authorOrFilter: User | CollectorFilter<[Message]>): CollectorOptions<[Message]> {\n\t\treturn {\n\t\t\tfilter: async (message: Message) =>\n\t\t\t\t(typeof authorOrFilter === 'function' ? await authorOrFilter(message) : message.author.id === authorOrFilter.id) &&\n\t\t\t\t!message.author.bot\n\t\t};\n\t}\n}\n","import type { CollectorFilter, EmojiIdentifierResolvable, MessageReaction, User } from 'discord.js';\nimport type { IMessagePrompterExplicitNumberReturn } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterNumberStrategyOptions } from '../strategyOptions';\nimport { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';\n\nexport class MessagePrompterNumberStrategy extends MessagePrompterBaseStrategy implements IMessagePrompterNumberStrategyOptions {\n\t/**\n\t * The available number emojis\n\t */\n\tpublic numberEmojis: EmojiIdentifierResolvable[];\n\t/**\n\t * The available number emojis\n\t */\n\tpublic start: number;\n\t/**\n\t * The available number emojis\n\t */\n\tpublic end: number;\n\n\t/**\n\t * Constructor for the {@link MessagePrompterBaseStrategy} class\n\t * @param message The message instance for this {@link MessagePrompter}\n\t * @param options Overrideable options if needed.\n\t */\n\tpublic constructor(message: MessagePrompterMessage, options: IMessagePrompterNumberStrategyOptions) {\n\t\tsuper('number', message, options);\n\n\t\tthis.numberEmojis = options?.numberEmojis ?? MessagePrompterNumberStrategy.numberEmojis;\n\t\tthis.start = options?.start ?? 0;\n\t\tthis.end = options?.end ?? 10;\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompter} and sends the message if {@link IMessagePrompterOptions.type} equals number.\n\t * The handler will wait for one (1) reaction.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t * @returns A promise that resolves to the selected number within the range.\n\t */\n\tpublic async run(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>\n\t): Promise<IMessagePrompterExplicitNumberReturn | number> {\n\t\t// 0 and 10 are the maximum available emojis as a number\n\t\tif (this.start < 0) throw new TypeError('Starting number cannot be less than 0.');\n\t\tif (this.end > 10) throw new TypeError('Ending number cannot be more than 10.');\n\n\t\tconst numbers = Array.from({ length: this.end - this.start + 1 }, (_, n: number) => n + this.start);\n\t\tconst emojis = this.numberEmojis.slice(this.start, this.end);\n\t\tconst response = await this.collectReactions(channel, authorOrFilter, emojis);\n\n\t\tconst emojiIndex = emojis.findIndex((emoji) => (response?.emoji?.id ?? response?.emoji?.name) === emoji);\n\t\tconst number = numbers[emojiIndex];\n\n\t\t// prettier-ignore\n\t\treturn this.explicitReturn ? { ...response, number } : number;\n\t}\n\n\t/**\n\t * The default available number emojis\n\t */\n\tpublic static numberEmojis = ['0️⃣', '1️⃣', '2️⃣', '3️⃣', '4️⃣', '5️⃣', '6️⃣', '7️⃣', '8️⃣', '9️⃣', '🔟'];\n}\n","import type { CollectorFilter, EmojiIdentifierResolvable, EmojiResolvable, MessageReaction, User } from 'discord.js';\nimport type { IMessagePrompterExplicitReturnBase } from '../ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from '../constants';\nimport type { IMessagePrompterReactionStrategyOptions } from '../strategyOptions';\nimport { MessagePrompterBaseStrategy } from './MessagePrompterBaseStrategy';\n\nexport class MessagePrompterReactionStrategy extends MessagePrompterBaseStrategy implements MessagePrompterReactionStrategy {\n\t/**\n\t * The emojis used\n\t */\n\tpublic reactions: EmojiIdentifierResolvable[];\n\n\t/**\n\t * Constructor for the {@link MessagePrompterReactionStrategy} class\n\t * @param message The message instance for this {@link MessagePrompter}\n\t * @param options Overrideable options if needed.\n\t */\n\tpublic constructor(message: MessagePrompterMessage, options: IMessagePrompterReactionStrategyOptions) {\n\t\tsuper('reactions', message, options);\n\n\t\tthis.reactions = options?.reactions;\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompterReactionStrategy} and sends the message.\n\t * The handler will wait for one (1) reaction.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t * @returns A promise that resolves to the reaction object.\n\t */\n\tpublic async run(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<[MessageReaction, User]>\n\t): Promise<IMessagePrompterExplicitReturnBase | string | EmojiResolvable> {\n\t\tif (!this.reactions?.length) throw new TypeError('There are no reactions provided.');\n\n\t\tconst response = await this.collectReactions(channel, authorOrFilter, this.reactions);\n\n\t\treturn this.explicitReturn ? response : (response.reaction ?? response);\n\t}\n}\n","import type { Ctor } from '@sapphire/utilities';\nimport type { CollectorFilter, EmojiResolvable, Message, MessageReaction, User } from 'discord.js';\nimport type {\n\tIMessagePrompterExplicitConfirmReturn,\n\tIMessagePrompterExplicitMessageReturn,\n\tIMessagePrompterExplicitNumberReturn,\n\tIMessagePrompterExplicitReturnBase\n} from './ExplicitReturnTypes';\nimport type { MessagePrompterChannelTypes, MessagePrompterMessage } from './constants';\nimport { MessagePrompterBaseStrategy } from './strategies/MessagePrompterBaseStrategy';\nimport { MessagePrompterConfirmStrategy } from './strategies/MessagePrompterConfirmStrategy';\nimport { MessagePrompterMessageStrategy } from './strategies/MessagePrompterMessageStrategy';\nimport { MessagePrompterNumberStrategy } from './strategies/MessagePrompterNumberStrategy';\nimport { MessagePrompterReactionStrategy } from './strategies/MessagePrompterReactionStrategy';\nimport type {\n\tIMessagePrompterConfirmStrategyOptions,\n\tIMessagePrompterNumberStrategyOptions,\n\tIMessagePrompterReactionStrategyOptions,\n\tIMessagePrompterStrategyOptions\n} from './strategyOptions';\n\nexport interface StrategyReturns {\n\tconfirm: IMessagePrompterExplicitConfirmReturn | boolean;\n\tmessage: IMessagePrompterExplicitMessageReturn | Message;\n\tnumber: IMessagePrompterExplicitNumberReturn | number;\n\treaction: IMessagePrompterExplicitReturnBase | string | EmojiResolvable;\n}\n\nexport interface StrategyOptions {\n\tconfirm: IMessagePrompterConfirmStrategyOptions;\n\tmessage: IMessagePrompterStrategyOptions;\n\tnumber: IMessagePrompterNumberStrategyOptions;\n\treaction: IMessagePrompterReactionStrategyOptions;\n}\n\nexport interface StrategyFilters {\n\tconfirm: [MessageReaction, User];\n\tmessage: [Message];\n\tnumber: [MessageReaction, User];\n\treaction: [MessageReaction, User];\n}\n\n/**\n * This is a {@link MessagePrompter}, a utility that sends a message, prompting for user input. The prompt can resolve to any kind of input.\n * There are several specifiable types to prompt for user input, and they are as follows:\n * - Confirm\n * This will send a simple Yes/No prompt, using reactions.\n * - Number\n * This will prompt for an integer. By default it will be a number between 0 and 10 (inclusive), however you can also specify your own custom range (inclusive).\n * - Reactions\n * This can be any kind of reaction emoji that Discord supports, and as many as you want. This type will return that reaction instead of a boolean.\n * - Message\n * This will prompt the user and require a response in the form of a message. This can be helpful if you require a user to upload an image for example, or give text input.\n *\n * You must either use this class directly or extend it.\n *\n * {@link MessagePrompter} uses reactions to prompt for a yes/no answer and returns it.\n * You can modify the confirm and cancel reaction used for each message, or use the {@link MessagePrompter.defaultPrompts}.\n * {@link MessagePrompter.defaultPrompts} is also static so you can modify these directly.\n *\n * @example\n * ```typescript\n * const { MessagePrompter } = require('@sapphire/discord.js-utilities');\n *\n * const handler = new MessagePrompter('Are you sure you want to continue?');\n * const result = await handler.run(channel, author);\n * ```\n *\n * @example\n * ```typescript\n * const { MessagePrompter } = require('@sapphire/discord.js-utilities');\n *\n * const handler = new MessagePrompter('Choose a number between 5 and 10?', 'number', {\n * \t\tstart: 5,\n * \t\tend: 10\n * });\n * const result = await handler.run(channel, author);\n * ```\n *\n * @example\n * ```typescript\n * const { MessagePrompter } = require('@sapphire/discord.js-utilities');\n *\n * const handler = new MessagePrompter('Are you happy or sad?', 'reaction', {\n * \t\treactions: ['🙂', '🙁']\n * });\n * const result = await handler.run(channel, author);\n * ```\n *\n * @example\n * ```typescript\n * const { MessagePrompter } = require('@sapphire/discord.js-utilities');\n *\n * const handler = new MessagePrompter('Do you love me?', 'message');\n * const result = await handler.run(channel, author);\n * ```\n */\nexport class MessagePrompter<S extends keyof StrategyReturns = 'confirm'> {\n\t/**\n\t * The strategy used in {@link MessagePrompter.run}\n\t */\n\tpublic strategy: MessagePrompterBaseStrategy;\n\n\t/**\n\t * Constructor for the {@link MessagePrompter} class\n\t * @param message The message to send.\n\t * @param strategy The strategy name or Instance to use\n\t * @param strategyOptions The options that are passed to the strategy\n\t */\n\tpublic constructor(\n\t\tmessage: MessagePrompterMessage | MessagePrompterBaseStrategy,\n\t\tstrategy?: S,\n\t\tstrategyOptions?: S extends keyof StrategyOptions ? StrategyOptions[S] : never\n\t) {\n\t\tlet strategyToRun: MessagePrompterBaseStrategy;\n\n\t\tif (message instanceof MessagePrompterBaseStrategy) {\n\t\t\tstrategyToRun = message;\n\t\t} else {\n\t\t\tconst mapStrategy = MessagePrompter.strategies.get(strategy ?? MessagePrompter.defaultStrategy);\n\n\t\t\tif (!mapStrategy) {\n\t\t\t\tthrow new Error('No strategy provided');\n\t\t\t}\n\n\t\t\tstrategyToRun = new mapStrategy(message, strategyOptions);\n\t\t}\n\n\t\tthis.strategy = strategyToRun;\n\t}\n\n\t/**\n\t * This executes the {@link MessagePrompter} and sends the message.\n\t * @param channel The channel to use.\n\t * @param authorOrFilter An author object to validate or a {@linkplain https://discord.js.org/docs/packages/discord.js/main/CollectorFilter:TypeAlias CollectorFilter} predicate callback.\n\t */\n\tpublic run<Filter extends S extends keyof StrategyFilters ? StrategyFilters[S] : unknown[]>(\n\t\tchannel: MessagePrompterChannelTypes,\n\t\tauthorOrFilter: User | CollectorFilter<Filter>\n\t): S extends keyof StrategyReturns ? Promise<StrategyReturns[S]> : never {\n\t\treturn this.strategy.run(channel, authorOrFilter as User | CollectorFilter<unknown[]>) as S extends keyof StrategyReturns\n\t\t\t? Promise<StrategyReturns[S]>\n\t\t\t: never;\n\t}\n\n\t/**\n\t * The available strategies\n\t */\n\tpublic static readonly strategies: Map<\n\t\tkeyof StrategyReturns,\n\t\tCtor<\n\t\t\t| ConstructorParameters<typeof MessagePrompterConfirmStrategy>\n\t\t\t| ConstructorParameters<typeof MessagePrompterNumberStrategy>\n\t\t\t| ConstructorParameters<typeof MessagePrompterReactionStrategy>\n\t\t\t| ConstructorParameters<typeof MessagePrompterMessageStrategy>,\n\t\t\tMessagePrompterConfirmStrategy | MessagePrompterNumberStrategy | MessagePrompterReactionStrategy | MessagePrompterMessageStrategy\n\t\t>\n\t\t// @ts-expect-error 2322\n\t> = new Map([\n\t\t['confirm', MessagePrompterConfirmStrategy],\n\t\t['number', MessagePrompterNumberStrategy],\n\t\t['reaction', MessagePrompterReactionStrategy],\n\t\t['message', MessagePrompterMessageStrategy]\n\t]);\n\n\t/**\n\t * The default strategy to use\n\t */\n\tpublic static defaultStrategy: keyof StrategyReturns = 'confirm';\n}\n","import { chunk, partition } from '@sapphire/utilities';\nimport {\n\tActionRowBuilder,\n\tButtonBuilder,\n\tButtonStyle,\n\tComponentType,\n\ttype APIActionRowComponent,\n\ttype APIComponentInMessageActionRow,\n\ttype ActionRowComponentOptions,\n\ttype ButtonComponentData,\n\ttype ChannelSelectMenuComponentData,\n\ttype MentionableSelectMenuComponentData,\n\ttype MessageActionRowComponentBuilder,\n\ttype RoleSelectMenuComponentData,\n\ttype StringSelectMenuComponentData,\n\ttype UserSelectMenuComponentData,\n\ttype APIButtonComponent\n} from 'discord.js';\nimport { isAnyInteractableInteraction, isMessageInstance } from '../type-guards';\nimport type {\n\tPaginatedMessageAction,\n\tPaginatedMessageActionButton,\n\tPaginatedMessageActionChannelMenu,\n\tPaginatedMessageActionLink,\n\tPaginatedMessageActionMentionableMenu,\n\tPaginatedMessageActionRoleMenu,\n\tPaginatedMessageActionStringMenu,\n\tPaginatedMessageActionUserMenu,\n\tPaginatedMessageComponentUnion,\n\tSafeReplyToInteractionParameters\n} from './PaginatedMessageTypes';\n\n/**\n * Checks if a PaginatedMessageAction is a button or menu.\n * @param action The PaginatedMessageAction to check.\n * @returns `true` if the action is a button or menu, `false` otherwise.\n */\nexport function actionIsButtonOrMenu(action: PaginatedMessageAction): action is Exclude<PaginatedMessageAction, PaginatedMessageActionLink> {\n\treturn (\n\t\taction.type === ComponentType.Button ||\n\t\taction.type === ComponentType.StringSelect ||\n\t\taction.type === ComponentType.UserSelect ||\n\t\taction.type === ComponentType.RoleSelect ||\n\t\taction.type === ComponentType.MentionableSelect ||\n\t\taction.type === ComponentType.ChannelSelect\n\t);\n}\n\n/**\n * Checks if a PaginatedMessageAction is a button with {@link ButtonStyle.Link style `link`}.\n * @param action The PaginatedMessageAction to check.\n * @returns `true` if the action is a button with {@link ButtonStyle.Link style `link`}, `false` otherwise.\n */\nexport function actionIsLinkButton(action: PaginatedMessageAction): action is PaginatedMessageActionLink {\n\treturn action.type === ComponentType.Button && action.style === ButtonStyle.Link;\n}\n\n/**\n * Checks if the given interaction is a button interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a button interaction, false otherwise.\n */\nexport function isMessageButtonInteractionData(interaction: ActionRowComponentOptions): interaction is ButtonComponentData {\n\treturn interaction.type === ComponentType.Button;\n}\n\n/**\n * Checks if the given interaction is a string select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a string select interaction, false otherwise.\n */\nexport function isMessageStringSelectInteractionData(interaction: ActionRowComponentOptions): interaction is StringSelectMenuComponentData {\n\treturn interaction.type === ComponentType.StringSelect;\n}\n\n/**\n * Checks if the given interaction is a user select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a user select interaction, false otherwise.\n */\nexport function isMessageUserSelectInteractionData(interaction: ActionRowComponentOptions): interaction is UserSelectMenuComponentData {\n\treturn interaction.type === ComponentType.UserSelect;\n}\n\n/**\n * Checks if the given interaction is a role select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a role select interaction, false otherwise.\n */\nexport function isMessageRoleSelectInteractionData(interaction: ActionRowComponentOptions): interaction is RoleSelectMenuComponentData {\n\treturn interaction.type === ComponentType.RoleSelect;\n}\n\n/**\n * Checks if the given interaction is a mentionable select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a mentionable select interaction, false otherwise.\n */\nexport function isMessageMentionableSelectInteractionData(interaction: ActionRowComponentOptions): interaction is MentionableSelectMenuComponentData {\n\treturn interaction.type === ComponentType.MentionableSelect;\n}\n\n/**\n * Checks if the given interaction is a channel select interaction.\n * @param interaction - The interaction to check.\n * @returns True if the interaction is a channel select interaction, false otherwise.\n */\nexport function isMessageChannelSelectInteractionData(interaction: ActionRowComponentOptions): interaction is ChannelSelectMenuComponentData {\n\treturn interaction.type === ComponentType.ChannelSelect;\n}\n\n/**\n * Checks if the given component is a button builder.\n * @param component - The component to check.\n * @returns True if the component is a button builder, false otherwise.\n */\nexport function isButtonComponentBuilder(component: MessageActionRowComponentBuilder): component is ButtonBuilder {\n\treturn component.data.type === ComponentType.Button;\n}\n\n/**\n * Checks if the given action is a paginated message action button.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action button, false otherwise.\n */\nexport function isActionButton(action: PaginatedMessageAction): action is PaginatedMessageActionButton {\n\treturn action.type === ComponentType.Button && action.style !== ButtonStyle.Link;\n}\n\n/**\n * Checks if the given action is a paginated message action link.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action link, false otherwise.\n */\nexport function isActionLink(action: PaginatedMessageAction): action is PaginatedMessageActionLink {\n\treturn action.type === ComponentType.Button && action.style === ButtonStyle.Link;\n}\n\n/**\n * Checks if the given action is a paginated message action string menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action string menu, false otherwise.\n */\nexport function isActionStringMenu(action: PaginatedMessageAction): action is PaginatedMessageActionStringMenu {\n\treturn action.type === ComponentType.StringSelect;\n}\n\n/**\n * Checks if the given action is a paginated message action user menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action user menu, false otherwise.\n */\nexport function isActionUserMenu(action: PaginatedMessageAction): action is PaginatedMessageActionUserMenu {\n\treturn action.type === ComponentType.UserSelect;\n}\n\n/**\n * Checks if the given action is a paginated message action role menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action role menu, false otherwise.\n */\nexport function isActionRoleMenu(action: PaginatedMessageAction): action is PaginatedMessageActionRoleMenu {\n\treturn action.type === ComponentType.RoleSelect;\n}\n\n/**\n * Checks if the given action is a paginated message action mentionable menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action mentionable menu, false otherwise.\n */\nexport function isActionMentionableMenu(action: PaginatedMessageAction): action is PaginatedMessageActionMentionableMenu {\n\treturn action.type === ComponentType.MentionableSelect;\n}\n\n/**\n * Checks if the given action is a paginated message action channel menu.\n * @param action - The action to check.\n * @returns True if the action is a paginated message action channel menu, false otherwise.\n */\nexport function isActionChannelMenu(action: PaginatedMessageAction): action is PaginatedMessageActionChannelMenu {\n\treturn action.type === ComponentType.ChannelSelect;\n}\n\n/**\n * Creates partitioned message rows based on the provided components.\n * @param components The array of MessageActionRowComponentBuilder objects.\n * @returns An array of `APIActionRowComponent<APIComponentInMessageActionRow>` objects.\n */\nexport function createPartitionedMessageRow(components: MessageActionRowComponentBuilder[]): PaginatedMessageComponentUnion[] {\n\t// Partition the components into two groups: buttons and select menus\n\tconst [messageButtons, selectMenus] = partition(components, isButtonComponentBuilder);\n\tconst [actionButtons, linkButtons] = partition(messageButtons, (value) => (value.data as Partial<APIButtonComponent>).style !== ButtonStyle.Link);\n\n\t// Chunk the button components in sets of 5, the maximum of 1 ActionRowBuilder\n\tconst chunkedActionButtonComponents = chunk(actionButtons, 5);\n\n\t// Map all the button components to ActionRowBuilders\n\tconst messageActionButtonActionRows = chunkedActionButtonComponents.map((componentsChunk) =>\n\t\tnew ActionRowBuilder() //\n\t\t\t.setComponents(componentsChunk)\n\t);\n\n\t// Map all the select menu components to ActionRowBuilders\n\tconst selectMenuActionRows = selectMenus.map((component) =>\n\t\tnew ActionRowBuilder() //\n\t\t\t.setComponents(component)\n\t);\n\n\t// Chunk the button components in sets of 5, the maximum of 1 ActionRowBuilder\n\tconst chunkedLinkButtonComponents = chunk(linkButtons, 5);\n\n\t// Map all the button components to ActionRowBuilders\n\tconst messageLinkButtonActionRows = chunkedLinkButtonComponents.map((componentsChunk) =>\n\t\tnew ActionRowBuilder() //\n\t\t\t.setComponents(componentsChunk)\n\t);\n\n\treturn [...messageActionButtonActionRows, ...selectMenuActionRows, ...messageLinkButtonActionRows].map((actionRow) =>\n\t\tactionRow.toJSON()\n\t) as APIActionRowComponent<APIComponentInMessageActionRow>[];\n}\n\n/**\n * Safely replies to a message or interaction. This is primarily to save duplicated code in the main `PaginatedMessage` class\n * @param parameters The parameters to create a safe reply to interaction parameters\n */\nexport async function safelyReplyToInteraction<T extends 'edit' | 'reply'>(parameters: SafeReplyToInteractionParameters<T>) {\n\tif (isAnyInteractableInteraction(parameters.messageOrInteraction)) {\n\t\tif (parameters.messageOrInteraction.replied || parameters.messageOrInteraction.deferred) {\n\t\t\tawait parameters.messageOrInteraction.editReply(parameters.interactionEditReplyContent);\n\t\t} else if (parameters.messageOrInteraction.isMessageComponent()) {\n\t\t\tawait parameters.messageOrInteraction.update(parameters.componentUpdateContent);\n\t\t} else {\n\t\t\tawait parameters.messageOrInteraction.reply(parameters.interactionReplyContent);\n\t\t}\n\t} else if (parameters.messageMethodContent && parameters.messageMethod && isMessageInstance(parameters.messageOrInteraction)) {\n\t\tawait parameters.messageOrInteraction[parameters.messageMethod](parameters.messageMethodContent as any);\n\t}\n}\n","import { Time } from '@sapphire/duration';\nimport { deepClone, isFunction, isNullish, isObject, type Awaitable } from '@sapphire/utilities';\nimport {\n\tButtonBuilder,\n\tButtonStyle,\n\tChannelSelectMenuBuilder,\n\tComponentType,\n\tEmbedBuilder,\n\tGatewayIntentBits,\n\tIntentsBitField,\n\tInteractionCollector,\n\tInteractionType,\n\tMentionableSelectMenuBuilder,\n\tMessageFlags,\n\tPartials,\n\tRoleSelectMenuBuilder,\n\tStringSelectMenuBuilder,\n\tUserSelectMenuBuilder,\n\tisJSONEncodable,\n\tuserMention,\n\ttype APIEmbed,\n\ttype BaseMessageOptions,\n\ttype Collection,\n\ttype JSONEncodable,\n\ttype Message,\n\ttype MessageActionRowComponentBuilder,\n\ttype Snowflake,\n\ttype User\n} from 'discord.js';\nimport { MessageBuilder } from '../builders/MessageBuilder';\nimport { isAnyInteraction, isGuildBasedChannel, isMessageInstance, isTextBasedChannel } from '../type-guards';\nimport type { AnyInteractableInteraction } from '../utility-types';\nimport type {\n\tEmbedResolvable,\n\tPaginatedMessageAction,\n\tPaginatedMessageComponentUnion,\n\tPaginatedMessageEmbedResolvable,\n\tPaginatedMessageInteractionUnion,\n\tPaginatedMessageInternationalizationContext,\n\tPaginatedMessageMessageOptionsUnion,\n\tPaginatedMessageOptions,\n\tPaginatedMessagePage,\n\tPaginatedMessageResolvedPage,\n\tPaginatedMessageSelectMenuOptionsFunction,\n\tPaginatedMessageStopReasons,\n\tPaginatedMessageWriteableEmbedResolvable,\n\tPaginatedMessageWrongUserInteractionReplyFunction\n} from './PaginatedMessageTypes';\nimport {\n\tactionIsButtonOrMenu,\n\tactionIsLinkButton,\n\tcreatePartitionedMessageRow,\n\tisMessageButtonInteractionData,\n\tisMessageChannelSelectInteractionData,\n\tisMessageMentionableSelectInteractionData,\n\tisMessageRoleSelectInteractionData,\n\tisMessageStringSelectInteractionData,\n\tisMessageUserSelectInteractionData,\n\tsafelyReplyToInteraction\n} from './utils';\n\n/**\n * This is a {@link PaginatedMessage}, a utility to paginate messages (usually embeds).\n * You must either use this class directly or extend it.\n *\n * @remark Please note that for {@link PaginatedMessage} to work in DMs to your client, you need to add the `'CHANNEL'` partial to your `client.options.partials`.\n * Message based commands can always be used in DMs, whereas Chat Input interactions can only be used in DMs when they are registered globally.\n *\n * {@link PaginatedMessage} uses {@linkplain https://discord.js.org/docs/packages/discord.js/main/MessageComponent:TypeAlias MessageComponent} buttons that perform the specified action when clicked.\n * You can either use your own actions or the {@link PaginatedMessage.defaultActions}.\n * {@link PaginatedMessage.defaultActions} is also static so you can modify these directly.\n *\n * {@link PaginatedMessage} also uses pages via {@linkplain https://discord.js.org/docs/packages/discord.js/main/Message:Class Messages}.\n *\n * @example\n * ```typescript\n * const myPaginatedMessage = new PaginatedMessage();\n * // Once you have an instance of PaginatedMessage you can call various methods on it to add pages to it.\n * // For more details see each method's documentation.\n *\n * myPaginatedMessage.addPageEmbed((embed) => {\n *\t\tembed\n *\t\t\t.setColor('#FF0000')\n *\t\t\t.setDescription('example description');\n *\n *\t\treturn embed;\n * });\n *\n * myPaginatedMessage.addPageBuilder((builder) => {\n *\t\tconst embed = new EmbedBuilder()\n *\t\t\t.setColor('#FF0000')\n *\t\t\t.setDescription('example description');\n *\n *\t\treturn builder\n *\t\t\t.setContent('example content')\n *\t\t\t.setEmbeds([embed]);\n * });\n *\n * myPaginatedMessage.addPageContent('Example');\n *\n * myPaginatedMessage.run(message)\n * ```\n *\n * @remark You can also provide a EmbedBuilder template. This will be applied to every page.\n * If a page itself has an embed then the two will be merged, with the content of\n * the page's embed taking priority over the template.\n *\n * Furthermore, if the template has a footer then it will be applied _after_ the page index part of the footer\n * with a space preceding the template. For example, when setting `- Powered by Sapphire Framework`\n * the resulting footer will be `1/2 - Powered by Sapphire Framework`\n * @example\n * ```typescript\n * const myPaginatedMessage = new PaginatedMessage({\n * \ttemplate: new EmbedBuilder().setColor('#FF0000').setFooter('- Powered by Sapphire framework')\n * });\n * ```\n *\n * @remark To utilize actions you can implement IPaginatedMessageAction into a class.\n * @example\n * ```typescript\n * class ForwardAction implements IPaginatedMessageAction {\n * public id = '▶️';\n *\n * public run({ handler }) {\n * if (handler.index !== handler.pages.length - 1) ++handler.index;\n * }\n * }\n *\n * // You can also give the object directly.\n *\n * const StopAction: IPaginatedMessageAction = {\n * customId: 'CustomStopAction',\n * run: ({ collector }) => {\n * collector.stop();\n * }\n * }\n * ```\n */\nexport class PaginatedMessage {\n\t// #region public static class properties\n\t/**\n\t * The default actions of this handler.\n\t */\n\tpublic static defaultActions: PaginatedMessageAction[] = [\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.goToPage',\n\t\t\ttype: ComponentType.StringSelect,\n\t\t\toptions: [],\n\t\t\trun: ({ handler, interaction }) => interaction.isStringSelectMenu() && (handler.index = parseInt(interaction.values[0], 10))\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.firstPage',\n\t\t\tstyle: ButtonStyle.Primary,\n\t\t\temoji: '⏪',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ handler }) => (handler.index = 0)\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.previousPage',\n\t\t\tstyle: ButtonStyle.Primary,\n\t\t\temoji: '◀️',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ handler }) => {\n\t\t\t\tif (handler.index === 0) {\n\t\t\t\t\thandler.index = handler.pages.length - 1;\n\t\t\t\t} else {\n\t\t\t\t\t--handler.index;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.nextPage',\n\t\t\tstyle: ButtonStyle.Primary,\n\t\t\temoji: '▶️',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ handler }) => {\n\t\t\t\tif (handler.index === handler.pages.length - 1) {\n\t\t\t\t\thandler.index = 0;\n\t\t\t\t} else {\n\t\t\t\t\t++handler.index;\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.goToLastPage',\n\t\t\tstyle: ButtonStyle.Primary,\n\t\t\temoji: '⏩',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ handler }) => (handler.index = handler.pages.length - 1)\n\t\t},\n\t\t{\n\t\t\tcustomId: '@sapphire/paginated-messages.stop',\n\t\t\tstyle: ButtonStyle.Danger,\n\t\t\temoji: '⏹️',\n\t\t\ttype: ComponentType.Button,\n\t\t\trun: ({ collector }) => {\n\t\t\t\tcollector.stop();\n\t\t\t}\n\t\t}\n\t];\n\n\t/**\n\t * Whether to emit the warning about running a {@link PaginatedMessage} in a DM channel without the client the `'CHANNEL'` partial.\n\t * @remark When using message based commands (as opposed to Application Commands) then you will also need to specify the `DIRECT_MESSAGE` intent for {@link PaginatedMessage} to work.\n\t *\n\t * @remark To overwrite this property change it somewhere in a \"setup\" file, i.e. where you also call `client.login()` for your client.\n\t * Alternatively, you can also customize it on a per-PaginatedMessage basis by using `paginatedMessageInstance.setEmitPartialDMChannelWarning(newBoolean)`\n\t * @default true\n\t */\n\tpublic static emitPartialDMChannelWarning = true;\n\n\t/**\n\t * A list of `customId` that are bound to actions that will stop the {@link PaginatedMessage}\n\t * @default ['@sapphire/paginated-messages.stop']\n\t * @remark To overwrite this property change it somewhere in a \"setup\" file, i.e. where you also call `client.login()` for your client.\n\t * Alternatively, you can also customize it on a per-PaginatedMessage basis by using `paginatedMessageInstance.setStopPaginatedMessageCustomIds(customIds)`\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t *\n\t * PaginatedMessage.stopPaginatedMessageCustomIds = ['my-custom-stop-custom-id'];\n\t * ```\n\t */\n\tpublic static stopPaginatedMessageCustomIds = ['@sapphire/paginated-messages.stop'];\n\n\t/**\n\t * The reasons sent by {@linkplain https://discord.js.org/docs/packages/discord.js/main/InteractionCollector:Class#end InteractionCollector#end}\n\t * event when the message (or its owner) has been deleted.\n\t */\n\tpublic static deletionStopReasons = ['messageDelete', 'channelDelete', 'guildDelete'];\n\n\t/**\n\t * Custom text to show in front of the page index in the embed footer.\n\t * PaginatedMessage will automatically add a space (` `) after the given text. You do not have to add it yourself.\n\t * @default \"\"\n\t * @remark To overwrite this property change it somewhere in a \"setup\" file, i.e. where you also call `client.login()` for your client.\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t *\n\t * PaginatedMessage.pageIndexPrefix = 'Page';\n\t * // This will make the footer of the embed something like \"Page 1/2\"\n\t * ```\n\t */\n\tpublic static pageIndexPrefix = '';\n\n\t/**\n\t * Custom separator for the page index in the embed footer.\n\t * @default \"•\"\n\t * @remark To overwrite this property change it somewhere in a \"setup\" file, i.e. where you also call `client.login()` for your client.\n\t * Alternatively, you can also customize it on a per-PaginatedMessage basis by passing `embedFooterSeparator` in the options of the constructor.\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t *\n\t * PaginatedMessage.embedFooterSeparator = '|';\n\t * // This will make the separator of the embed footer something like \"Page 1/2 | Today at 4:20\"\n\t * ```\n\t */\n\tpublic static embedFooterSeparator = '•';\n\n\t/**\n\t * The messages that are currently being handled by a {@link PaginatedMessage}\n\t * The key is the ID of the message that triggered this {@link PaginatedMessage}\n\t *\n\t * This is to ensure that only 1 {@link PaginatedMessage} can run on a specified message at once.\n\t * This is important when having an editable commands solution.\n\t */\n\tpublic static readonly messages = new Map<string, PaginatedMessage>();\n\n\t/**\n\t * The current {@link InteractionCollector} handlers that are active.\n\t * The key is the ID of of the author who sent the message that triggered this {@link PaginatedMessage}\n\t *\n\t * This is to ensure that any given author can only trigger 1 {@link PaginatedMessage}.\n\t * This is important for performance reasons, and users should not have more than 1 {@link PaginatedMessage} open at once.\n\t */\n\tpublic static readonly handlers = new Map<string, PaginatedMessage>();\n\n\t/**\n\t * A generator for {@link MessageSelectOption} that will be used to generate the options for the {@link StringSelectMenuBuilder}.\n\t * We do not allow overwriting the {@link MessageSelectOption#value} property with this, as it is vital to how we handle\n\t * select menu interactions.\n\t *\n\t * @param pageIndex The index of the page to add to the {@link StringSelectMenuBuilder}. We will add 1 to this number because our pages are 0 based,\n\t * so this will represent the pages as seen by the user.\n\t * @default\n\t * ```ts\n\t * {\n\t * \tlabel: `Page ${pageIndex}`\n\t * }\n\t * ```\n\t * @remark To overwrite this property change it in a \"setup\" file prior to calling `client.login()` for your client.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t *\n\t * PaginatedMessage.selectMenuOptions = (pageIndex) => ({\n\t * \t label: `Go to page: ${pageIndex}`,\n\t * \t description: 'This is a description'\n\t * });\n\t * ```\n\t */\n\tpublic static selectMenuOptions: PaginatedMessageSelectMenuOptionsFunction = (pageIndex) => ({ label: `Page ${pageIndex}` });\n\n\t/**\n\t * A generator for {@link MessageComponentInteraction#reply} that will be called and sent whenever an untargeted user interacts with one of the buttons.\n\t * When modifying this it is recommended that the message is set to be ephemeral so only the user that is pressing the buttons can see them.\n\t * Furthermore, we also recommend setting `allowedMentions: { users: [], roles: [] }`, so you don't have to worry about accidentally pinging anyone.\n\t *\n\t * When setting just a string, we will add `{ flags: MessageFlags.Ephemeral, allowedMentions: { users: [], roles: [] } }` for you.\n\t *\n\t * @param targetUser The {@link User} this {@link PaginatedMessage} was intended for.\n\t * @param interactionUser The {@link User} that actually clicked the button.\n\t * @default\n\t * ```ts\n\t * import { userMention } from 'discord.js';\n\t *\n\t * {\n\t * \tcontent: `Please stop interacting with the components on this message. They are only for ${userMention(targetUser.id)}.`,\n\t * \tflags: MessageFlags.Ephemeral,\n\t * \tallowedMentions: { users: [], roles: [] }\n\t * }\n\t * ```\n\t * @remark To overwrite this property change it in a \"setup\" file prior to calling `client.login()` for your client.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t * import { userMention } from 'discord.js';\n\t *\n\t * // We will add ephemeral and no allowed mention for string only overwrites\n\t * PaginatedMessage.wrongUserInteractionReply = (targetUser) =>\n\t * `These buttons are only for ${userMention(targetUser.id)}. Press them as much as you want, but I won't do anything with your clicks.`;\n\t * ```\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessage } from '@sapphire/discord.js-utilities';\n\t * import { userMention } from 'discord.js';\n\t *\n\t * PaginatedMessage.wrongUserInteractionReply = (targetUser) => ({\n\t * \tcontent: `These buttons are only for ${userMention(\n\t * \t\ttargetUser.id\n\t * \t)}. Press them as much as you want, but I won't do anything with your clicks.`,\n\t * \tflags: MessageFlags.Ephemeral,\n\t * \tallowedMentions: { users: [], roles: [] }\n\t * });\n\t * ```\n\t */\n\tpublic static wrongUserInteractionReply: PaginatedMessageWrongUserInteractionReplyFunction = (targetUser: User) => ({\n\t\tcontent: `Please stop interacting with the components on this message. They are only for ${userMention(targetUser.id)}.`,\n\t\tflags: MessageFlags.Ephemeral,\n\t\tallowedMentions: { users: [], roles: [] }\n\t});\n\t// #endregion\n\n\t// #region private static class properties\n\t/**\n\t * Resolves the template for the PaginatedMessage.\n\t *\n\t * @param template - The template to resolve.\n\t * @returns The resolved template as a BaseMessageOptions object.\n\t */\n\tprivate static resolveTemplate(template?: JSONEncodable<APIEmbed> | BaseMessageOptions): BaseMessageOptions {\n\t\tif (template === undefined) {\n\t\t\treturn {};\n\t\t}\n\n\t\tif (isJSONEncodable(template)) {\n\t\t\treturn { embeds: [template.toJSON()] };\n\t\t}\n\n\t\treturn template;\n\t}\n\t// #endregion\n\n\t// #region public class properties\n\t/**\n\t * The pages to be converted to {@link PaginatedMessage.messages}\n\t */\n\tpublic pages: PaginatedMessagePage[] = [];\n\n\t/**\n\t * The response message used to edit on page changes.\n\t */\n\tpublic response: Message | AnyInteractableInteraction | null = null;\n\n\t/**\n\t * The collector used for handling component interactions.\n\t */\n\tpublic collector: InteractionCollector<PaginatedMessageInteractionUnion> | null = null;\n\n\t/**\n\t * The pages which were converted from {@link PaginatedMessage.pages}\n\t */\n\tpublic messages: (PaginatedMessageResolvedPage | null)[] = [];\n\n\t/**\n\t * The actions which are to be used.\n\t */\n\tpublic actions = new Map<string, PaginatedMessageAction>();\n\n\t/**\n\t * The page-specific actions which are to be used.\n\t */\n\tpublic pageActions: (Map<string, PaginatedMessageAction> | null)[] = [];\n\n\t/**\n\t * The handler's current page/message index.\n\t */\n\tpublic index = 0;\n\n\t/**\n\t * The amount of milliseconds to idle before the paginator is closed.\n\t * @default 14.5 minutes\n\t * @remark This is to ensure it is a bit before interactions expire.\n\t */\n\tpublic idle = Time.Minute * 14.5;\n\n\t/**\n\t * The template for this {@link PaginatedMessage}.\n\t * You can use templates to set defaults that will apply to each and every page in the {@link PaginatedMessage}\n\t */\n\tpublic template: PaginatedMessageMessageOptionsUnion;\n\n\t/**\n\t * Custom text to show in front of the page index in the embed footer.\n\t * PaginatedMessage will automatically add a space (` `) after the given text. You do not have to add it yourself.\n\t * @default ```PaginatedMessage.pageIndexPrefix``` (static property)\n\t */\n\tpublic pageIndexPrefix = PaginatedMessage.pageIndexPrefix;\n\n\t/**\n\t * Custom separator to show after the page index in the embed footer.\n\t * PaginatedMessage will automatically add a space (` `) after the given text. You do not have to add it yourself.\n\t * @default ```PaginatedMessage.embedFooterSeparator``` (static property)\n\t */\n\tpublic embedFooterSeparator = PaginatedMessage.embedFooterSeparator;\n\n\t/**\n\t * A list of `customId` that are bound to actions that will stop the {@link PaginatedMessage}\n\t * @default ```PaginatedMessage.stopPaginatedMessageCustomIds``` (static property)\n\t */\n\tpublic stopPaginatedMessageCustomIds = PaginatedMessage.stopPaginatedMessageCustomIds;\n\n\t/**\n\t * Whether to emit the warning about running a {@link PaginatedMessage} in a DM channel without the client having the `'CHANNEL'` partial.\n\t * @remark When using message based commands (as opposed to Application Commands) then you will also need to specify the `DIRECT_MESSAGE` intent for {@link PaginatedMessage} to work.\n\t *\n\t * @default ```PaginatedMessage.emitPartialDMChannelWarning``` (static property)\n\t */\n\tpublic emitPartialDMChannelWarning = PaginatedMessage.emitPartialDMChannelWarning;\n\t// #endregion\n\n\t// #region protected class properties\n\t/**\n\t * Data for the paginated message.\n\t */\n\tprotected paginatedMessageData: Omit<PaginatedMessageMessageOptionsUnion, 'components'> | null = null;\n\n\t/**\n\t * The placeholder for the select menu.\n\t */\n\tprotected selectMenuPlaceholder: string | undefined = undefined;\n\n\t/**\n\t * Tracks whether a warning was already emitted for this {@link PaginatedMessage}\n\t * concerning the maximum amount of pages in the {@link SelectMenu}.\n\t *\n\t * @default false\n\t */\n\tprotected hasEmittedMaxPageWarning = false;\n\n\t/**\n\t * Tracks whether a warning was already emitted for this {@link PaginatedMessage}\n\t * concerning the {@link PaginatedMessage} being called in a `DMChannel`\n\t * without the client having the `'Channel'` partial.\n\t *\n\t * @remark When using message based commands (as opposed to Application Commands) then you will also need to specify the `DIRECT_MESSAGE` intent for {@link PaginatedMessage} to work.\n\t * @default false\n\t */\n\tprotected hasEmittedPartialDMChannelWarning = false;\n\n\t/**\n\t * Determines whether the default footer that shows the current page number should be added to the embeds.\n\t *\n\t * @note If this is set to false, i.e.e through {@link setShouldAddFooterToEmbeds}, then {@link embedFooterSeparator}\n\t * is never applied.\n\t *\n\t * @default true\n\t */\n\tprotected shouldAddFooterToEmbeds = true;\n\n\t/**\n\t * Function that returns the select menu options for the paginated message.\n\t * @param message The paginated message.\n\t * @returns The select menu options.\n\t */\n\tprotected selectMenuOptions: PaginatedMessageSelectMenuOptionsFunction = PaginatedMessage.selectMenuOptions;\n\n\t/**\n\t * Function that handles the reply when a user interacts with the paginated message incorrectly.\n\t */\n\tprotected wrongUserInteractionReply: PaginatedMessageWrongUserInteractionReplyFunction = PaginatedMessage.wrongUserInteractionReply;\n\t// #endregion\n\n\t// #region private class fields\n\t/** The response we send when someone gets into an invalid flow */\n\treadonly #thisMazeWasNotMeantForYouContent = { content: \"This maze wasn't meant for you...what did you do.\" };\n\t// #endregion\n\n\t/**\n\t * Constructor for the {@link PaginatedMessage} class\n\t * @param __namedParameters The {@link PaginatedMessageOptions} for this instance of the {@link PaginatedMessage} class\n\t */\n\tpublic constructor({\n\t\tpages,\n\t\tactions,\n\t\ttemplate,\n\t\tpageIndexPrefix,\n\t\tembedFooterSeparator,\n\t\tpaginatedMessageData = null\n\t}: PaginatedMessageOptions = {}) {\n\t\tif (pages) this.addPages(pages);\n\n\t\tthis.addActions(actions ?? this.constructor.defaultActions);\n\n\t\tthis.template = PaginatedMessage.resolveTemplate(template);\n\t\tthis.pageIndexPrefix = pageIndexPrefix ?? PaginatedMessage.pageIndexPrefix;\n\t\tthis.embedFooterSeparator = embedFooterSeparator ?? PaginatedMessage.embedFooterSeparator;\n\t\tthis.paginatedMessageData = paginatedMessageData;\n\t}\n\n\t// #region property setters\n\t/**\n\t * Sets the {@link PaginatedMessage.selectMenuOptions} for this instance of {@link PaginatedMessage}.\n\t * This will only apply to this one instance and no others.\n\t * @param newOptions The new options generator to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setSelectMenuOptions(newOptions: PaginatedMessageSelectMenuOptionsFunction): this {\n\t\tthis.selectMenuOptions = newOptions;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the {@link PaginatedMessage.selectMenuPlaceholder} for this instance of {@link PaginatedMessage}.\n\t *\n\t * This applies only to the string select menu from the {@link PaginatedMessage.defaultActions}\n\t * that offers \"go to page\" (we internally check the customId for this)\n\t *\n\t * This will only apply to this one instance and no others.\n\t * @param placeholder The new placeholder to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setSelectMenuPlaceholder(placeholder: string | undefined): this {\n\t\tthis.selectMenuPlaceholder = placeholder;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the {@link PaginatedMessage.wrongUserInteractionReply} for this instance of {@link PaginatedMessage}.\n\t * This will only apply to this one instance and no others.\n\t * @param wrongUserInteractionReply The new `wrongUserInteractionReply` to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setWrongUserInteractionReply(wrongUserInteractionReply: PaginatedMessageWrongUserInteractionReplyFunction): this {\n\t\tthis.wrongUserInteractionReply = wrongUserInteractionReply;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the {@link PaginatedMessage.stopPaginatedMessageCustomIds} for this instance of {@link PaginatedMessage}.\n\t * This will only apply to this one instance and no others.\n\t * @param stopPaginatedMessageCustomIds The new `stopPaginatedMessageCustomIds` to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setStopPaginatedMessageCustomIds(stopPaginatedMessageCustomIds: string[]): this {\n\t\tthis.stopPaginatedMessageCustomIds = stopPaginatedMessageCustomIds;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the {@link PaginatedMessage.emitPartialDMChannelWarning} for this instance of {@link PaginatedMessage}.\n\t * This will only apply to this one instance and no others.\n\t * @param emitPartialDMChannelWarning The new `emitPartialDMChannelWarning` to set\n\t * @returns The current instance of {@link PaginatedMessage}\n\t */\n\tpublic setEmitPartialDMChannelWarning(emitPartialDMChannelWarning: boolean): this {\n\t\tthis.emitPartialDMChannelWarning = emitPartialDMChannelWarning;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the handler's current page/message index.\n\t * @param index The number to set the index to.\n\t */\n\tpublic setIndex(index: number): this {\n\t\tthis.index = index;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the amount of time to idle before the paginator is closed.\n\t * @param idle The number to set the idle to.\n\t */\n\tpublic setIdle(idle: number): this {\n\t\tthis.idle = idle;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the value of {@link shouldAddFooterToEmbeds} property and returns the instance of the class.\n\t * @param newValue - The new value for {@link shouldAddFooterToEmbeds}.\n\t * @returns The instance of the class with the updated {@link shouldAddFooterToEmbeds} value.\n\t */\n\tpublic setShouldAddFooterToEmbeds(newValue: boolean): this {\n\t\tthis.shouldAddFooterToEmbeds = newValue;\n\t\treturn this;\n\t}\n\t// #endregion\n\n\t// #region actions related methods\n\t/**\n\t * Clears all current actions and sets them. The order given is the order they will be used.\n\t * @param actions The actions to set. This can be either a Button, Link Button, or Select Menu.\n\t * @param includeDefaultActions Whether to merge in the {@link PaginatedMessage.defaultActions} when setting the actions.\n\t * If you set this to true then you do not need to manually add `...PaginatedMessage.defaultActions` as seen in the first example.\n\t * The default value is `false` for backwards compatibility within the current major version.\n\t *\n\t * @remark You can retrieve the default actions for the regular pagination\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setActions([\n\t * ...PaginatedMessage.defaultActions,\n\t * ])\n\t * ```\n\t *\n\t * @remark You can add custom Message Buttons by providing `style`, `customId`, `type`, `run` and at least one of `label` or `emoji`.\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setActions([\n\t * {\n\t * style: 'PRIMARY',\n\t * label: 'My Button',\n\t * customId: 'custom_button',\n\t * type: ComponentType.Button,\n\t * run: (context) => console.log(context)\n\t * }\n\t * ], true);\n\t * ```\n\t *\n\t * @remark You can add custom Message **Link** Buttons by providing `style`, `url`, `type`, and at least one of `label` or `emoji`.\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setActions([\n\t * {\n\t * style: 'LINK',\n\t * label: 'Sapphire Website',\n\t * emoji: '🔷',\n\t * url: 'https://sapphirejs.dev',\n\t * type: ComponentType.Button\n\t * }\n\t * ], true);\n\t * ```\n\t *\n\t * @remark You can add custom Select Menus by providing `customId`, `type`, and `run`.\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setActions([\n\t * {\n\t * customId: 'custom_menu',\n\t * type: ComponentType.StringSelect,\n\t * run: (context) => console.log(context) // Do something here\n\t * }\n\t * ], true);\n\t * ```\n\t */\n\tpublic setActions(actions: PaginatedMessageAction[], includeDefaultActions = false): this {\n\t\tthis.actions.clear();\n\t\treturn this.addActions([...(includeDefaultActions ? PaginatedMessage.defaultActions : []), ...actions]);\n\t}\n\n\t/**\n\t * Adds actions to the existing ones. The order given is the order they will be used.\n\t * @param actions The actions to add.\n\t * @see {@link PaginatedMessage.setActions} for examples on how to structure the actions.\n\t */\n\tpublic addActions(actions: PaginatedMessageAction[]): this {\n\t\tfor (const action of actions) this.addAction(action);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds an action to the existing ones. This will be added as the last action.\n\t * @param action The action to add.\n\t * @see {@link PaginatedMessage.setActions} for examples on how to structure the action.\n\t */\n\tpublic addAction(action: PaginatedMessageAction): this {\n\t\tif (actionIsLinkButton(action)) {\n\t\t\tthis.actions.set(action.url, action);\n\t\t} else if (actionIsButtonOrMenu(action)) {\n\t\t\tthis.actions.set(action.customId, action);\n\t\t}\n\n\t\treturn this;\n\t}\n\t// #endregion\n\n\t// #region page related methods\n\t/**\n\t * Checks whether or not the handler has a specific page.\n\t * @param index The index to check.\n\t */\n\tpublic hasPage(index: number): boolean {\n\t\treturn index >= 0 && index < this.pages.length;\n\t}\n\n\t/**\n\t * Clears all current pages and messages and sets them. The order given is the order they will be used.\n\t * @param pages The pages to set.\n\t */\n\tpublic setPages(pages: PaginatedMessagePage[]) {\n\t\tthis.pages = [];\n\t\tthis.messages = [];\n\t\tthis.addPages(pages);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a page to the existing ones. This will be added as the last page.\n\t * @remark While you can use this method you should first check out\n\t * {@link PaginatedMessage.addPageBuilder},\n\t * {@link PaginatedMessage.addPageContent} and\n\t * {@link PaginatedMessage.addPageEmbed} as\n\t * these are easier functional methods of adding pages and will likely already suffice for your needs.\n\t *\n\t * @param page The page to add.\n\t */\n\tpublic addPage(page: PaginatedMessagePage): this {\n\t\t// Do not allow more than 25 pages, and send a warning when people try to do so.\n\t\tif (this.pages.length === 25) {\n\t\t\tif (!this.hasEmittedMaxPageWarning) {\n\t\t\t\tprocess.emitWarning(\n\t\t\t\t\t'Maximum amount of pages exceeded for PaginatedMessage. Please check your instance of PaginatedMessage and ensure that you do not exceed 25 pages total.',\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'PaginatedMessageExceededMessagePageAmount',\n\t\t\t\t\t\tcode: 'PAGINATED_MESSAGE_EXCEEDED_MAXIMUM_AMOUNT_OF_PAGES',\n\t\t\t\t\t\tdetail: `If you do need more than 25 pages you can extend the class and overwrite the actions in the constructor.`\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tthis.hasEmittedMaxPageWarning = true;\n\t\t\t}\n\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.pages.push(page);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Update the current page.\n\t * @param page The content to update the page with.\n\t *\n\t * @remark This method can only be used after {@link PaginatedMessage.run} has been used.\n\t */\n\tpublic async updateCurrentPage(page: PaginatedMessagePage): Promise<this> {\n\t\tconst interaction = this.response;\n\t\tconst currentIndex = this.index;\n\n\t\tif (interaction === null) {\n\t\t\tthrow new Error('You cannot update a page before responding to the interaction.');\n\t\t}\n\n\t\tthis.pages[currentIndex] = page;\n\t\tthis.messages[currentIndex] = null;\n\t\tthis.pageActions[currentIndex]?.clear();\n\n\t\tconst target = isAnyInteraction(interaction) ? interaction.user : interaction.author;\n\t\tawait this.resolvePage(interaction, target, currentIndex);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Adds a page to the existing ones using a {@link MessageBuilder}. This will be added as the last page.\n\t * @param builder Either a callback whose first parameter is `new MessageBuilder()`, or an already constructed {@link MessageBuilder}\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t * const { EmbedBuilder } = require('discord.js');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageBuilder((builder) => {\n\t * \t\tconst embed = new EmbedBuilder()\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription('example description');\n\t *\n\t * \t\treturn builder\n\t * \t\t\t.setContent('example content')\n\t * \t\t\t.setEmbeds([embed]);\n\t * });\n\t * ```\n\t * @example\n\t * ```typescript\n\t * const { EmbedBuilder } = require('discord.js');\n\t * const { MessageBuilder, PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const embed = new EmbedBuilder()\n\t * \t.setColor('#FF0000')\n\t * \t.setDescription('example description');\n\t *\n\t * const builder = new MessageBuilder()\n\t * \t.setContent('example content')\n\t * \t.setEmbeds([embed]);\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageBuilder(builder);\n\t * ```\n\t */\n\tpublic addPageBuilder(builder: MessageBuilder | ((builder: MessageBuilder) => MessageBuilder)): this {\n\t\treturn this.addPage(isFunction(builder) ? builder(new MessageBuilder()) : builder);\n\t}\n\n\t/**\n\t * Adds a page to the existing ones asynchronously using a {@link MessageBuilder}. This wil be added as the last page.\n\t * @param builder Either a callback whose first parameter is `new MessageBuilder()`, or an already constructed {@link MessageBuilder}\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t * const { EmbedBuilder } = require('discord.js');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addAsyncPageBuilder(async (builder) => {\n\t * \t\tconst someRemoteData = await fetch('https://contoso.com/api/users');\n\t *\n\t * \t\tconst embed = new EmbedBuilder()\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription(someRemoteData.data);\n\t *\n\t * \t\treturn builder\n\t * \t\t\t.setContent('example content')\n\t * \t\t\t.setEmbeds([embed]);\n\t * });\n\t * ```\n\t */\n\tpublic addAsyncPageBuilder(builder: MessageBuilder | ((builder: MessageBuilder) => Promise<MessageBuilder>)): this {\n\t\treturn this.addPage(async () => (isFunction(builder) ? builder(new MessageBuilder()) : builder));\n\t}\n\n\t/**\n\t * Adds a page to the existing ones using simple message content. This will be added as the last page.\n\t * @param content The content to set.\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageContent('example content');\n\t * ```\n\t */\n\tpublic addPageContent(content: string): this {\n\t\treturn this.addPage({ content });\n\t}\n\n\t/**\n\t * Adds a page to the existing ones using a {@link EmbedBuilder}. This wil be added as the last page.\n\t * @param embed Either a callback whose first parameter is `new EmbedBuilder()`, or an already constructed {@link EmbedBuilder}\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageEmbed((embed) => {\n\t * \t\tembed\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription('example description');\n\t *\n\t * \t\treturn embed;\n\t * });\n\t * ```\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const embed = new EmbedBuilder()\n\t * \t.setColor('#FF0000')\n\t * \t.setDescription('example description');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageEmbed(embed);\n\t * ```\n\t */\n\tpublic addPageEmbed(embed: EmbedResolvable | ((embed: EmbedBuilder) => EmbedResolvable)): this {\n\t\treturn this.addPage({ embeds: isFunction(embed) ? [embed(new EmbedBuilder())] : [embed] });\n\t}\n\n\t/**\n\t * Adds a page to the existing ones asynchronously using a {@link EmbedBuilder}. This wil be added as the last page.\n\t * @param embed Either a callback whose first parameter is `new EmbedBuilder()`, or an already constructed {@link EmbedBuilder}\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addAsyncPageEmbed(async (embed) => {\n\t *\t\tconst someRemoteData = await fetch('https://contoso.com/api/users');\n\t *\n\t * \t\tembed\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription(someRemoteData.data);\n\t *\n\t * \t\treturn embed;\n\t * });\n\t * ```\n\t */\n\tpublic addAsyncPageEmbed(embed: EmbedResolvable | ((builder: EmbedBuilder) => Awaitable<EmbedResolvable>)): this {\n\t\treturn this.addPage(async () => ({ embeds: isFunction(embed) ? [await embed(new EmbedBuilder())] : [embed] }));\n\t}\n\n\t/**\n\t * Adds a page to the existing ones asynchronously using multiple {@link EmbedBuilder}'s. This wil be added as the last page.\n\t * @remark When using this with a callback this will construct 10 {@link EmbedBuilder}'s in the callback parameters, regardless of how many are actually used.\n\t * If this a performance impact you do not want to cope with then it is recommended to use {@link PaginatedMessage.addPageBuilder} instead, which will let you add\n\t * as many embeds as you want, albeit manually\n\t * @param embeds Either a callback which receives 10 parameters of `new EmbedBuilder()`, or an array of already constructed {@link EmbedBuilder}'s\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageEmbeds((embed1, embed2, embed3) => { // You can add up to 10 embeds\n\t * \t\tembed1\n\t * \t\t\t.setColor('#FF0000')\n\t * \t\t\t.setDescription('example description 1');\n\t *\n\t * \t\tembed2\n\t * \t\t\t.setColor('#00FF00')\n\t * \t\t\t.setDescription('example description 2');\n\t *\n\t * \t\tembed3\n\t * \t\t\t.setColor('#0000FF')\n\t * \t\t\t.setDescription('example description 3');\n\t *\n\t * \t\treturn [embed1, embed2, embed3];\n\t * });\n\t * ```\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const embed1 = new EmbedBuilder()\n\t * \t.setColor('#FF0000')\n\t * \t.setDescription('example description 1');\n\t *\n\t * const embed2 = new EmbedBuilder()\n\t * \t.setColor('#00FF00')\n\t * \t.setDescription('example description 2');\n\t *\n\t * const embed3 = new EmbedBuilder()\n\t * \t.setColor('#0000FF')\n\t * \t.setDescription('example description 3');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addPageEmbeds([embed1, embed2, embed3]); // You can add up to 10 embeds\n\t * ```\n\t */\n\tpublic addPageEmbeds(\n\t\tembeds:\n\t\t\t| EmbedResolvable[]\n\t\t\t| ((\n\t\t\t\t\tembed1: EmbedBuilder,\n\t\t\t\t\tembed2: EmbedBuilder,\n\t\t\t\t\tembed3: EmbedBuilder,\n\t\t\t\t\tembed4: EmbedBuilder,\n\t\t\t\t\tembed5: EmbedBuilder,\n\t\t\t\t\tembed6: EmbedBuilder,\n\t\t\t\t\tembed7: EmbedBuilder,\n\t\t\t\t\tembed8: EmbedBuilder,\n\t\t\t\t\tembed9: EmbedBuilder,\n\t\t\t\t\tembed10: EmbedBuilder\n\t\t\t ) => EmbedResolvable[])\n\t): this {\n\t\tlet processedEmbeds = isFunction(embeds)\n\t\t\t? embeds(\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\tnew EmbedBuilder()\n\t\t\t\t)\n\t\t\t: embeds;\n\n\t\tif (processedEmbeds.length > 10) {\n\t\t\tprocessedEmbeds = processedEmbeds.slice(0, 10);\n\t\t}\n\n\t\treturn this.addPage({ embeds: processedEmbeds });\n\t}\n\n\t/**\n\t * Adds a page to the existing ones using multiple {@link EmbedBuilder}'s. This wil be added as the last page.\n\t * @remark When using this with a callback this will construct 10 {@link EmbedBuilder}'s in the callback parameters, regardless of how many are actually used.\n\t * If this a performance impact you do not want to cope with then it is recommended to use {@link PaginatedMessage.addPageBuilder} instead, which will let you add\n\t * as many embeds as you want, albeit manually\n\t * @param embeds Either a callback which receives 10 parameters of `new EmbedBuilder()`, or an array of already constructed {@link EmbedBuilder}'s\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const paginatedMessage = new PaginatedMessage().addAsyncPageEmbeds(async (embed0, embed1, embed2) => {\n\t * \tconst someRemoteData = (await fetch('https://contoso.com/api/users')) as any;\n\t *\n\t * \tfor (const [index, user] of Object.entries(someRemoteData.users.slice(0, 10)) as [`${0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10}`, any][]) {\n\t * \t\tswitch (index) {\n\t * \t\t\tcase '0': {\n\t * \t\t\t\tembed0.setColor('#FF0000').setDescription('example description 1').setAuthor(user.name);\n\t * \t\t\t\tbreak;\n\t * \t\t\t}\n\t * \t\t\tcase '1': {\n\t * \t\t\t\tembed1.setColor('#00FF00').setDescription('example description 2').setAuthor(user.name);\n\t * \t\t\t\tbreak;\n\t * \t\t\t}\n\t * \t\t\tcase '2': {\n\t * \t\t\t\tembed2.setColor('#0000FF').setDescription('example description 3').setAuthor(user.name);\n\t * \t\t\t\tbreak;\n\t * \t\t\t}\n\t * \t\t}\n\t * \t}\n\t *\n\t * \treturn [embed0, embed1, embed2];\n\t * });\n\t * ```\n\t * @example\n\t * ```typescript\n\t * const { PaginatedMessage } = require('@sapphire/discord.js-utilities');\n\t *\n\t * const embed1 = new EmbedBuilder()\n\t * \t.setColor('#FF0000')\n\t * \t.setDescription('example description 1');\n\t *\n\t * const embed2 = new EmbedBuilder()\n\t * \t.setColor('#00FF00')\n\t * \t.setDescription('example description 2');\n\t *\n\t * const embed3 = new EmbedBuilder()\n\t * \t.setColor('#0000FF')\n\t * \t.setDescription('example description 3');\n\t *\n\t * const paginatedMessage = new PaginatedMessage()\n\t * \t.addAsyncPageEmbeds([embed1, embed2, embed3]); // You can add up to 10 embeds\n\t * ```\n\t */\n\tpublic addAsyncPageEmbeds(\n\t\tembeds:\n\t\t\t| EmbedResolvable[]\n\t\t\t| ((\n\t\t\t\t\tembed1: EmbedBuilder,\n\t\t\t\t\tembed2: EmbedBuilder,\n\t\t\t\t\tembed3: EmbedBuilder,\n\t\t\t\t\tembed4: EmbedBuilder,\n\t\t\t\t\tembed5: EmbedBuilder,\n\t\t\t\t\tembed6: EmbedBuilder,\n\t\t\t\t\tembed7: EmbedBuilder,\n\t\t\t\t\tembed8: EmbedBuilder,\n\t\t\t\t\tembed9: EmbedBuilder,\n\t\t\t\t\tembed10: EmbedBuilder\n\t\t\t ) => Awaitable<EmbedResolvable[]>)\n\t): this {\n\t\treturn this.addPage(async () => {\n\t\t\tlet processedEmbeds = isFunction(embeds)\n\t\t\t\t? await embeds(\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder()\n\t\t\t\t\t)\n\t\t\t\t: embeds;\n\n\t\t\tif (processedEmbeds.length > 10) {\n\t\t\t\tprocessedEmbeds = processedEmbeds.slice(0, 10);\n\t\t\t}\n\n\t\t\treturn { embeds: processedEmbeds };\n\t\t});\n\t}\n\n\t/**\n\t * Add pages to the existing ones. The order given is the order they will be used.\n\t * @param pages The pages to add.\n\t */\n\tpublic addPages(pages: PaginatedMessagePage[]): this {\n\t\tfor (const page of pages) this.addPage(page);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Clear all actions for a page and set the new ones.\n\t * @param actions The actions to set.\n\t * @param index The index of the page to set the actions to. **This is 0-based**.\n\t *\n\t * @remark Internally we check if the provided index exists.\n\t * This means that calling this function _before_ calling any of the methods below this will not work as the amount of pages will always be 0,\n\t * thus the index will always be out of bounds. That said, make sure you first define your pages and _then_ define your actions for those pages.\n\t * - {@link PaginatedMessage.addAsyncPageEmbed}\n\t * - {@link PaginatedMessage.addPageBuilder}\n\t * - {@link PaginatedMessage.addPageContent}\n\t * - {@link PaginatedMessage.addPageEmbed}\n\t * - {@link PaginatedMessage.addPageEmbeds}\n\t * - {@link PaginatedMessage.addPages}\n\t * - {@link PaginatedMessage.setPages}\n\t *\n\t * @remark Add a select menu to the first page, while preserving all default actions:\n\t * @example\n\t * ```typescript\n\t * const display = new PaginatedMessage();\n\t *\n\t * display.setPageActions([\n\t * {\n\t * customId: 'custom_menu',\n\t * type: ComponentType.StringSelect,\n\t * run: (context) => console.log(context) // Do something here\n\t * }\n\t * ], 0);\n\t * ```\n\t * @see {@link PaginatedMessage.setActions} for more examples on how to structure the action.\n\t */\n\tpublic setPageActions(actions: PaginatedMessageAction[], index: number): this {\n\t\tif (index < 0 || index > this.pages.length - 1) throw new Error('Provided index is out of bounds');\n\n\t\tthis.pageActions[index]?.clear();\n\t\tthis.addPageActions(actions, index);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Add the provided actions to a page.\n\t * @param actions The actions to add.\n\t * @param index The index of the page to add the actions to.\n\t * @see {@link PaginatedMessage.setActions} for examples on how to structure the actions.\n\t *\n\t * @remark Internally we check if the provided index exists.\n\t * This means that calling this function _before_ calling any of the methods below this will not work as the amount of pages will always be 0,\n\t * thus the index will always be out of bounds. That said, make sure you first define your pages and _then_ define your actions for those pages.\n\t * - {@link PaginatedMessage.addAsyncPageEmbed}\n\t * - {@link PaginatedMessage.addPageBuilder}\n\t * - {@link PaginatedMessage.addPageContent}\n\t * - {@link PaginatedMessage.addPageEmbed}\n\t * - {@link PaginatedMessage.addPageEmbeds}\n\t * - {@link PaginatedMessage.addPages}\n\t * - {@link PaginatedMessage.setPages}\n\t */\n\tpublic addPageActions(actions: PaginatedMessageAction[], index: number): this {\n\t\tif (index < 0 || index > this.pages.length - 1) throw new Error('Provided index is out of bounds');\n\n\t\tfor (const action of actions) {\n\t\t\tthis.addPageAction(action, index);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Add the provided action to a page.\n\t * @param action The action to add.\n\t * @param index The index of the page to add the action to.\n\t * @see {@link PaginatedMessage.setActions} for examples on how to structure the action.\n\t *\n\t * @remark Internally we check if the provided index exists.\n\t * This means that calling this function _before_ calling any of the methods below this will not work as the amount of pages will always be 0,\n\t * thus the index will always be out of bounds. That said, make sure you first define your pages and _then_ define your actions for those pages.\n\t * - {@link PaginatedMessage.addAsyncPageEmbed}\n\t * - {@link PaginatedMessage.addPageBuilder}\n\t * - {@link PaginatedMessage.addPageContent}\n\t * - {@link PaginatedMessage.addPageEmbed}\n\t * - {@link PaginatedMessage.addPageEmbeds}\n\t * - {@link PaginatedMessage.addPages}\n\t * - {@link PaginatedMessage.setPages}\n\t */\n\tpublic addPageAction(action: PaginatedMessageAction, index: number): this {\n\t\tif (index < 0 || index > this.pages.length - 1) throw new Error('Provided index is out of bounds');\n\n\t\tconst pageActionAtIndex = this.pageActions[index] ?? new Map<string, PaginatedMessageAction>();\n\n\t\tif (actionIsLinkButton(action)) {\n\t\t\tpageActionAtIndex.set(action.url, action);\n\t\t} else if (actionIsButtonOrMenu(action)) {\n\t\t\tpageActionAtIndex.set(action.customId, action);\n\t\t}\n\n\t\tthis.pageActions[index] = pageActionAtIndex;\n\n\t\treturn this;\n\t}\n\t// #endregion\n\n\t/**\n\t * Executes the {@link PaginatedMessage} and sends the pages corresponding with {@link PaginatedMessage.index}.\n\t * The handler will start collecting message component interactions.\n\t *\n\t * @remark Please note that for {@link PaginatedMessage} to work in DMs to your client, you need to add the `'CHANNEL'` partial to your `client.options.partials`.\n\t * Message based commands can always be used in DMs, whereas Chat Input interactions can only be used in DMs when they are registered globally.\n\t *\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * Generally this will be the command message or an interaction\n\t * (either a {@link CommandInteraction}, {@link ContextMenuInteraction}, or an interaction from {@link PaginatedMessageInteractionUnion}),\n\t * but it can also be another message from your client, i.e. to indicate a loading state.\n\t *\n\t * @param target The user who will be able to interact with the buttons of this {@link PaginatedMessage}.\n\t * If `messageOrInteraction` is an instance of {@link Message} then this defaults to {@link Message.author messageOrInteraction.author},\n\t * and if it is an instance of {@link CommandInteraction} then it defaults to {@link CommandInteraction.user messageOrInteraction.user}.\n\t */\n\tpublic async run(messageOrInteraction: Message | AnyInteractableInteraction, target?: User): Promise<this> {\n\t\t// If there is no channel then exit early and potentially emit a warning\n\t\tif (!messageOrInteraction.channel) {\n\t\t\tconst isInteraction = isAnyInteraction(messageOrInteraction);\n\t\t\tlet shouldEmitWarning = this.emitPartialDMChannelWarning;\n\n\t\t\t// If we are to emit a warning,\n\t\t\t// then check if a warning was already emitted,\n\t\t\t// in which case we don't want to emit a warning.\n\t\t\tif (shouldEmitWarning && this.hasEmittedPartialDMChannelWarning) {\n\t\t\t\tshouldEmitWarning = false;\n\t\t\t}\n\n\t\t\t// If we are to emit a warning,\n\t\t\t// then check if the interaction is an interaction based command,\n\t\t\t// and check if the client has the Partials.Channel partial,\n\t\t\t// in which case we don't want to emit a warning.\n\t\t\tif (shouldEmitWarning && isInteraction && messageOrInteraction.client.options.partials?.includes(Partials.Channel)) {\n\t\t\t\tshouldEmitWarning = false;\n\t\t\t}\n\n\t\t\t// IF we are to emit a warning,\n\t\t\t// then check if the interaction is a message based command,\n\t\t\t// and check if the client has the Partials.Channel partial,\n\t\t\t// and check if the client has the 'DIRECT_MESSAGE' intent',\n\t\t\t// in which case we don't want to emit a warning.\n\t\t\tif (\n\t\t\t\tshouldEmitWarning &&\n\t\t\t\t!isInteraction &&\n\t\t\t\tmessageOrInteraction.client.options.partials?.includes(Partials.Channel) &&\n\t\t\t\tnew IntentsBitField(messageOrInteraction.client.options.intents).has(GatewayIntentBits.DirectMessages)\n\t\t\t) {\n\t\t\t\tshouldEmitWarning = false;\n\t\t\t}\n\n\t\t\t// If we should emit a warning then do so.\n\t\t\tif (shouldEmitWarning) {\n\t\t\t\tprocess.emitWarning(\n\t\t\t\t\t[\n\t\t\t\t\t\t'PaginatedMessage was initiated in a DM channel without the client having the required partial configured.',\n\t\t\t\t\t\t'If you want PaginatedMessage to work in DM channels then make sure you start your client with \"CHANNEL\" added to \"client.options.partials\".',\n\t\t\t\t\t\t'Furthermore if you are using message based commands (as opposed to application commands) then you will also need to add the \"DIRECT_MESSAGE\" intent to \"client.options.intents\"',\n\t\t\t\t\t\t'If you do not want to be alerted about this in the future then you can disable this warning by setting \"PaginatedMessage.emitPartialDMChannelWarning\" to \"false\", or use \"setEmitPartialDMChannelWarning(false)\" before calling \"run\".'\n\t\t\t\t\t].join('\\n'),\n\t\t\t\t\t{\n\t\t\t\t\t\ttype: 'PaginatedMessageRunsInNonpartialDMChannel',\n\t\t\t\t\t\tcode: 'PAGINATED_MESSAGE_RUNS_IN_NON_PARTIAL_DM_CHANNEL'\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t\tthis.hasEmittedPartialDMChannelWarning = true;\n\t\t\t}\n\n\t\t\tawait safelyReplyToInteraction({\n\t\t\t\tmessageOrInteraction,\n\t\t\t\tinteractionEditReplyContent: this.#thisMazeWasNotMeantForYouContent,\n\t\t\t\tinteractionReplyContent: { ...this.#thisMazeWasNotMeantForYouContent, flags: MessageFlags.Ephemeral },\n\t\t\t\tcomponentUpdateContent: this.#thisMazeWasNotMeantForYouContent,\n\t\t\t\tmessageMethod: 'reply',\n\t\t\t\tmessageMethodContent: this.#thisMazeWasNotMeantForYouContent\n\t\t\t});\n\n\t\t\treturn this;\n\t\t}\n\n\t\t// Assign the target based on whether a Message or CommandInteraction was passed in\n\t\ttarget ??= isAnyInteraction(messageOrInteraction) ? messageOrInteraction.user : messageOrInteraction.author;\n\n\t\t// Try to get the previous PaginatedMessage for this user\n\t\tconst paginatedMessage = PaginatedMessage.handlers.get(target.id);\n\n\t\t// If a PaginatedMessage was found then stop it\n\t\tpaginatedMessage?.collector?.stop();\n\n\t\t// If the message was sent by a bot, then set the response as this one\n\t\tif (isAnyInteraction(messageOrInteraction)) {\n\t\t\tif (messageOrInteraction.user.bot && messageOrInteraction.user.id === messageOrInteraction.client.user?.id) {\n\t\t\t\tthis.response = messageOrInteraction;\n\t\t\t}\n\t\t} else if (messageOrInteraction.author.bot && messageOrInteraction.author.id === messageOrInteraction.client.user?.id) {\n\t\t\tthis.response = messageOrInteraction;\n\t\t}\n\n\t\tawait this.resolvePagesOnRun(messageOrInteraction, target);\n\n\t\t// Sanity checks to handle\n\t\tif (!this.messages.length) throw new Error('There are no messages.');\n\t\tif (!this.actions.size && !this.pageActions.length) throw new Error('There are no actions nor page actions.');\n\n\t\tawait this.setUpMessage(messageOrInteraction);\n\t\tthis.setUpCollector(messageOrInteraction, target);\n\n\t\tconst messageId = this.response!.id;\n\n\t\tif (this.collector) {\n\t\t\tthis.collector.once('end', () => {\n\t\t\t\tPaginatedMessage.messages.delete(messageId);\n\t\t\t\tPaginatedMessage.handlers.delete(target.id);\n\t\t\t});\n\n\t\t\tPaginatedMessage.messages.set(messageId, this);\n\t\t\tPaginatedMessage.handlers.set(target.id, this);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Executed whenever {@link PaginatedMessage.run} is called.\n\t */\n\tpublic async resolvePagesOnRun(messageOrInteraction: Message | AnyInteractableInteraction, target: User): Promise<void> {\n\t\tfor (let i = 0; i < this.pages.length; i++) {\n\t\t\tawait this.resolvePage(messageOrInteraction, target, i);\n\t\t}\n\t}\n\n\t/**\n\t * Executed whenever an action is triggered and resolved.\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * @param target The user who will be able to interact with the buttons of this {@link PaginatedMessage}.\n\t * @param index The index to resolve.\n\t */\n\tpublic async resolvePage(\n\t\tmessageOrInteraction: Message | AnyInteractableInteraction,\n\t\ttarget: User,\n\t\tindex: number\n\t): Promise<PaginatedMessageResolvedPage> {\n\t\t// If the message was already processed, do not load it again:\n\t\tconst message = this.messages[index];\n\t\tif (!isNullish(message)) {\n\t\t\treturn message;\n\t\t}\n\n\t\t// Load the page and return it:\n\t\tconst resolvedPage = await this.handlePageLoad(this.pages[index], index);\n\t\tif (resolvedPage.actions) {\n\t\t\tthis.addPageActions(resolvedPage.actions, index);\n\t\t}\n\n\t\tconst pageSpecificActions = this.pageActions.at(index);\n\t\tconst resolvedComponents: PaginatedMessageComponentUnion[] = [];\n\n\t\tif (this.pages.length > 1) {\n\t\t\tconst sharedActions = await this.handleActionLoad([...this.actions.values()], messageOrInteraction, target);\n\t\t\tconst sharedComponents = createPartitionedMessageRow(sharedActions);\n\n\t\t\tresolvedComponents.push(...sharedComponents);\n\t\t}\n\n\t\tif (pageSpecificActions) {\n\t\t\tconst pageActions = await this.handleActionLoad([...pageSpecificActions.values()], messageOrInteraction, target);\n\t\t\tconst pageComponents = createPartitionedMessageRow(pageActions);\n\n\t\t\tresolvedComponents.push(...pageComponents);\n\t\t}\n\n\t\tconst resolved = { ...resolvedPage, components: resolvedComponents };\n\t\tthis.messages[index] = resolved;\n\n\t\treturn resolved;\n\t}\n\n\t/**\n\t * Clones the current handler into a new instance.\n\t */\n\tpublic clone(): PaginatedMessage {\n\t\tconst clone = new this.constructor({ pages: this.pages, actions: [] }).setIndex(this.index).setIdle(this.idle);\n\t\tclone.actions = this.actions;\n\t\tclone.pageActions = this.pageActions;\n\t\tclone.response = this.response;\n\t\tclone.template = this.template;\n\t\treturn clone;\n\t}\n\n\t/**\n\t * Get the options of a page.\n\t * @param index The index of the page.\n\t */\n\tpublic async getPageOptions(index: number): Promise<PaginatedMessageMessageOptionsUnion | undefined> {\n\t\tconst page = this.pages.at(index);\n\t\treturn isFunction(page) ? page(index, this.pages, this) : page;\n\t}\n\n\t/**\n\t * Sets up the message.\n\t *\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * Generally this will be the command message or an interaction\n\t * (either a {@link CommandInteraction}, {@link ContextMenuInteraction}, or an interaction from {@link PaginatedMessageInteractionUnion}),\n\t * but it can also be another message from your client, i.e. to indicate a loading state.\n\t */\n\tprotected async setUpMessage(messageOrInteraction: Message | AnyInteractableInteraction): Promise<void> {\n\t\t// Get the current page\n\t\tlet page = this.messages[this.index]!;\n\n\t\t// Merge in the advanced options\n\t\tpage = { ...page, ...(this.paginatedMessageData ?? {}) };\n\n\t\tif (this.response) {\n\t\t\tif (isAnyInteraction(this.response)) {\n\t\t\t\tif (this.response.replied || this.response.deferred) {\n\t\t\t\t\tawait this.response.editReply(page);\n\t\t\t\t} else {\n\t\t\t\t\tawait this.response.reply({ ...page, content: page.content ?? undefined });\n\t\t\t\t}\n\t\t\t} else if (isMessageInstance(this.response)) {\n\t\t\t\tawait this.response.edit(page);\n\t\t\t}\n\t\t} else if (isAnyInteraction(messageOrInteraction)) {\n\t\t\tif (messageOrInteraction.replied || messageOrInteraction.deferred) {\n\t\t\t\tconst editReplyResponse = await messageOrInteraction.editReply(page);\n\t\t\t\tthis.response = messageOrInteraction.ephemeral ? messageOrInteraction : editReplyResponse;\n\t\t\t} else {\n\t\t\t\tthis.response = await messageOrInteraction.reply({\n\t\t\t\t\t...page,\n\t\t\t\t\tcontent: page.content ?? undefined,\n\t\t\t\t\tfetchReply: true,\n\t\t\t\t\tephemeral: false\n\t\t\t\t});\n\t\t\t}\n\t\t} else if (isTextBasedChannel(messageOrInteraction.channel)) {\n\t\t\tthis.response = await messageOrInteraction.channel.send({ ...page, content: page.content ?? undefined });\n\t\t}\n\t}\n\n\t/**\n\t * Sets up the message's collector.\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * @param targetUser The user the handler is for.\n\t */\n\tprotected setUpCollector(messageOrInteraction: Message<boolean> | AnyInteractableInteraction, targetUser: User): void {\n\t\tif (this.pages.length > 1) {\n\t\t\tthis.collector = new InteractionCollector<PaginatedMessageInteractionUnion>(targetUser.client, {\n\t\t\t\tfilter: (interaction) => {\n\t\t\t\t\tif (!isNullish(this.response) && interaction.isMessageComponent()) {\n\t\t\t\t\t\tconst customIdValidation =\n\t\t\t\t\t\t\tthis.actions.has(interaction.customId) || this.pageActions.some((actions) => actions?.has(interaction.customId));\n\n\t\t\t\t\t\tif (isAnyInteraction(messageOrInteraction) && messageOrInteraction.ephemeral) {\n\t\t\t\t\t\t\treturn interaction.user.id === targetUser.id && customIdValidation;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn customIdValidation;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn false;\n\t\t\t\t},\n\n\t\t\t\ttime: this.idle,\n\n\t\t\t\tguild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild : undefined,\n\n\t\t\t\tchannel: messageOrInteraction.channel as Message['channel'],\n\n\t\t\t\tinteractionType: InteractionType.MessageComponent,\n\n\t\t\t\t...(!isNullish(this.response) && !isAnyInteraction(this.response)\n\t\t\t\t\t? {\n\t\t\t\t\t\t\tmessage: this.response\n\t\t\t\t\t\t}\n\t\t\t\t\t: {})\n\t\t\t})\n\t\t\t\t.on('collect', this.handleCollect.bind(this, targetUser, messageOrInteraction.channel as Message['channel']))\n\t\t\t\t.on('end', this.handleEnd.bind(this));\n\t\t}\n\t}\n\n\t/**\n\t * Handles the load of a page.\n\t * @param page The page to be loaded.\n\t * @param index The index of the current page.\n\t */\n\tprotected async handlePageLoad(page: PaginatedMessagePage, index: number): Promise<PaginatedMessageMessageOptionsUnion> {\n\t\t// Resolve the options from a function or an object\n\t\tconst options = isFunction(page) ? await page(index, this.pages, this) : page;\n\n\t\t// Clone the template to leave the original intact\n\t\tconst clonedTemplate = deepClone(this.template);\n\n\t\t// Apply the template to the page\n\t\tconst optionsWithTemplate = this.applyTemplate(clonedTemplate, options);\n\n\t\t// Apply the footer to the embed, if any\n\t\treturn this.applyFooter(optionsWithTemplate, index);\n\t}\n\n\t/**\n\t * Handles the loading of actions.\n\t * @param actions The actions to be loaded.\n\t * @param messageOrInteraction The message or interaction that triggered this {@link PaginatedMessage}.\n\t * @param targetUser The user the handler is for.\n\t */\n\tprotected async handleActionLoad(\n\t\tactions: PaginatedMessageAction[],\n\t\tmessageOrInteraction: Message | AnyInteractableInteraction,\n\t\ttargetUser: User\n\t): Promise<MessageActionRowComponentBuilder[]> {\n\t\treturn Promise.all(\n\t\t\tactions.map<Promise<MessageActionRowComponentBuilder>>(async (interaction) => {\n\t\t\t\tif (isMessageButtonInteractionData(interaction)) {\n\t\t\t\t\treturn new ButtonBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageUserSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new UserSelectMenuBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageRoleSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new RoleSelectMenuBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageMentionableSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new MentionableSelectMenuBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageChannelSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new ChannelSelectMenuBuilder(interaction);\n\t\t\t\t}\n\n\t\t\t\tif (isMessageStringSelectInteractionData(interaction)) {\n\t\t\t\t\treturn new StringSelectMenuBuilder({\n\t\t\t\t\t\t...interaction,\n\t\t\t\t\t\t...(interaction.customId === '@sapphire/paginated-messages.goToPage' && {\n\t\t\t\t\t\t\toptions: await Promise.all(\n\t\t\t\t\t\t\t\tthis.pages.map(async (_, index) => {\n\t\t\t\t\t\t\t\t\treturn {\n\t\t\t\t\t\t\t\t\t\t...(await this.selectMenuOptions(\n\t\t\t\t\t\t\t\t\t\t\tindex + 1,\n\t\t\t\t\t\t\t\t\t\t\tthis.resolvePaginatedMessageInternationalizationContext(messageOrInteraction, targetUser)\n\t\t\t\t\t\t\t\t\t\t)),\n\t\t\t\t\t\t\t\t\t\tvalue: index.toString()\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tplaceholder: this.selectMenuPlaceholder\n\t\t\t\t\t\t})\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthrow new Error(\n\t\t\t\t\t\"Unsupported message component type detected. Validate your code and if you're sure this is a bug in Sapphire make a report in the server\"\n\t\t\t\t);\n\t\t\t})\n\t\t);\n\t}\n\n\t/**\n\t * Handles the `collect` event from the collector.\n\t * @param targetUser The user the handler is for.\n\t * @param channel The channel the handler is running at.\n\t * @param interaction The button interaction that was received.\n\t */\n\tprotected async handleCollect(targetUser: User, channel: Message['channel'], interaction: PaginatedMessageInteractionUnion): Promise<void> {\n\t\tif (interaction.user.id === targetUser.id) {\n\t\t\t// Update the response to the latest interaction\n\t\t\tthis.response = interaction;\n\n\t\t\tconst action = this.getAction(interaction.customId, this.index);\n\t\t\tif (isNullish(action)) {\n\t\t\t\tthrow new Error('There was no action for the provided custom ID');\n\t\t\t}\n\n\t\t\tif (actionIsButtonOrMenu(action) && action.run) {\n\t\t\t\tconst previousIndex = this.index;\n\n\t\t\t\tawait action.run({\n\t\t\t\t\tinteraction,\n\t\t\t\t\thandler: this,\n\t\t\t\t\tauthor: targetUser,\n\t\t\t\t\tchannel,\n\t\t\t\t\tresponse: this.response,\n\t\t\t\t\tcollector: this.collector!\n\t\t\t\t});\n\n\t\t\t\tif (!this.stopPaginatedMessageCustomIds.includes(action.customId)) {\n\t\t\t\t\tconst newIndex = previousIndex === this.index ? previousIndex : this.index;\n\t\t\t\t\tconst updateOptions = await this.resolvePage(this.response, targetUser, newIndex);\n\n\t\t\t\t\tawait safelyReplyToInteraction({\n\t\t\t\t\t\tmessageOrInteraction: interaction,\n\t\t\t\t\t\tinteractionEditReplyContent: updateOptions,\n\t\t\t\t\t\tinteractionReplyContent: { ...this.#thisMazeWasNotMeantForYouContent, flags: MessageFlags.Ephemeral },\n\t\t\t\t\t\tcomponentUpdateContent: updateOptions\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tconst interactionReplyOptions = await this.wrongUserInteractionReply(\n\t\t\t\ttargetUser,\n\t\t\t\tinteraction.user,\n\t\t\t\tthis.resolvePaginatedMessageInternationalizationContext(interaction, targetUser)\n\t\t\t);\n\n\t\t\tawait interaction.reply(\n\t\t\t\tisObject(interactionReplyOptions)\n\t\t\t\t\t? interactionReplyOptions\n\t\t\t\t\t: { content: interactionReplyOptions, flags: MessageFlags.Ephemeral, allowedMentions: { users: [], roles: [] } }\n\t\t\t);\n\t\t}\n\t}\n\n\t/**\n\t * Handles the `end` event from the collector.\n\t * @param reason The reason for which the collector was ended.\n\t */\n\tprotected async handleEnd(_: Collection<Snowflake, PaginatedMessageInteractionUnion>, reason: PaginatedMessageStopReasons): Promise<void> {\n\t\t// Ensure no race condition can occur where interacting with the message when the paginated message closes would otherwise result in a DiscordAPIError\n\t\tif (\n\t\t\t(reason === 'time' || reason === 'idle') &&\n\t\t\tthis.response !== null &&\n\t\t\tisAnyInteraction(this.response) &&\n\t\t\tthis.response.isMessageComponent()\n\t\t) {\n\t\t\tthis.response.message = await this.response.fetchReply();\n\t\t}\n\n\t\t// Remove all listeners from the collector:\n\t\tthis.collector?.removeAllListeners();\n\n\t\t// Do not remove components if the message, channel, or guild, was deleted:\n\t\tif (this.response && !PaginatedMessage.deletionStopReasons.includes(reason)) {\n\t\t\tvoid safelyReplyToInteraction({\n\t\t\t\tmessageOrInteraction: this.response,\n\t\t\t\tinteractionEditReplyContent: { components: [] },\n\t\t\t\tinteractionReplyContent: { ...this.#thisMazeWasNotMeantForYouContent, flags: MessageFlags.Ephemeral },\n\t\t\t\tcomponentUpdateContent: { components: [] },\n\t\t\t\tmessageMethod: 'edit',\n\t\t\t\tmessageMethodContent: { components: [] }\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Applies footer to the last embed of the page\n\t * @param message The message options\n\t * @param index The current index\n\t * @returns The message options with the footer applied\n\t */\n\tprotected applyFooter(message: PaginatedMessageMessageOptionsUnion, index: number): PaginatedMessageMessageOptionsUnion {\n\t\tif (!message.embeds?.length) {\n\t\t\treturn message;\n\t\t}\n\n\t\tconst embedsWithFooterApplied = deepClone(message.embeds) as PaginatedMessageWriteableEmbedResolvable;\n\n\t\tconst idx = embedsWithFooterApplied.length - 1;\n\t\tif (embedsWithFooterApplied.length > 0) {\n\t\t\tlet lastEmbed = embedsWithFooterApplied[idx];\n\t\t\tconst templateEmbed = this.template.embeds?.[idx] ?? this.template.embeds?.[0];\n\t\t\tconst jsonTemplateEmbed = isJSONEncodable(templateEmbed) ? templateEmbed.toJSON() : templateEmbed;\n\n\t\t\tif (isJSONEncodable(lastEmbed)) {\n\t\t\t\tlastEmbed = lastEmbed.toJSON();\n\t\t\t\tembedsWithFooterApplied[idx] = lastEmbed;\n\t\t\t}\n\n\t\t\tlastEmbed.footer ??= { text: jsonTemplateEmbed?.footer?.text ?? '' };\n\n\t\t\tif (this.shouldAddFooterToEmbeds) {\n\t\t\t\tlastEmbed.footer.text = `${this.pageIndexPrefix ? `${this.pageIndexPrefix} ` : ''}${index + 1} / ${this.pages.length}${\n\t\t\t\t\tlastEmbed.footer.text ? ` ${this.embedFooterSeparator} ${lastEmbed.footer.text}` : ''\n\t\t\t\t}`;\n\t\t\t}\n\t\t}\n\n\t\treturn { ...message, embeds: embedsWithFooterApplied };\n\t}\n\n\t/**\n\t * Constructs a {@link PaginatedMessageInternationalizationContext}\n\t * @param messageOrInteraction The message or interaction for which the {@link PaginatedMessageInternationalizationContext} should be resolved.\n\t * @param targetUser The target user for whom this interaction is\n\t * @returns A constructed {@link PaginatedMessageInternationalizationContext}\n\t */\n\tprotected resolvePaginatedMessageInternationalizationContext(\n\t\tmessageOrInteraction: Message | AnyInteractableInteraction,\n\t\ttargetUser: User\n\t): PaginatedMessageInternationalizationContext {\n\t\tconst context: PaginatedMessageInternationalizationContext = {\n\t\t\tuser: targetUser,\n\t\t\tchannel: messageOrInteraction.channel,\n\t\t\tguild: isGuildBasedChannel(messageOrInteraction.channel) ? messageOrInteraction.channel.guild : null,\n\t\t\tinteractionGuildLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.guildLocale : undefined,\n\t\t\tinteractionLocale: isAnyInteraction(messageOrInteraction) ? messageOrInteraction.locale : undefined\n\t\t};\n\n\t\treturn context;\n\t}\n\n\t/**\n\t * Applies a template to the provided options, merging them together and applying the template's embeds.\n\t *\n\t * @param template - The template to apply.\n\t * @param options - The options to merge with the template.\n\t * @returns The merged options with the template's embeds applied.\n\t */\n\tprivate applyTemplate(\n\t\ttemplate: PaginatedMessageMessageOptionsUnion,\n\t\toptions: PaginatedMessageMessageOptionsUnion\n\t): PaginatedMessageMessageOptionsUnion {\n\t\tconst embedData = this.applyTemplateEmbed(template.embeds, options.embeds);\n\n\t\treturn { ...template, ...options, embeds: embedData };\n\t}\n\n\t/**\n\t * Applies a template embed to the page embeds.\n\t * If the page embeds are nullish, it returns the template embed as an array.\n\t * If the template embed is nullish, it returns the page embeds.\n\t * Otherwise, it merges the template embed with the first page embed.\n\t *\n\t * @param templateEmbed - The template embed to apply.\n\t * @param pageEmbeds - The page embeds to apply the template to.\n\t * @returns The resulting embeds after applying the template.\n\t */\n\tprivate applyTemplateEmbed(\n\t\ttemplateEmbed: PaginatedMessageEmbedResolvable,\n\t\tpageEmbeds: PaginatedMessageEmbedResolvable\n\t): PaginatedMessageEmbedResolvable {\n\t\tif (isNullish(pageEmbeds)) {\n\t\t\treturn templateEmbed ? [templateEmbed?.[0]] : undefined;\n\t\t}\n\n\t\tif (isNullish(templateEmbed)) {\n\t\t\treturn pageEmbeds;\n\t\t}\n\n\t\treturn this.mergeEmbeds(templateEmbed[0], pageEmbeds);\n\t}\n\n\t/**\n\t * Merges the template embed with an array of page embeds.\n\t *\n\t * @param templateEmbed - The template embed to merge.\n\t * @param pageEmbeds - The array of page embeds to merge.\n\t * @returns The merged embeds.\n\t */\n\tprivate mergeEmbeds(\n\t\ttemplateEmbed: Exclude<PaginatedMessageEmbedResolvable, undefined>[0],\n\t\tpageEmbeds: Exclude<PaginatedMessageEmbedResolvable, undefined>\n\t): Exclude<PaginatedMessageEmbedResolvable, undefined> {\n\t\tconst mergedEmbeds: PaginatedMessageWriteableEmbedResolvable = [];\n\n\t\tconst jsonTemplate = isJSONEncodable(templateEmbed) ? templateEmbed.toJSON() : templateEmbed;\n\n\t\tfor (const pageEmbed of pageEmbeds) {\n\t\t\tconst pageJson = isJSONEncodable(pageEmbed) ? pageEmbed.toJSON() : pageEmbed;\n\n\t\t\tmergedEmbeds.push({\n\t\t\t\ttitle: pageJson.title ?? jsonTemplate.title ?? undefined,\n\t\t\t\tdescription: pageJson.description ?? jsonTemplate.description ?? undefined,\n\t\t\t\turl: pageJson.url ?? jsonTemplate.url ?? undefined,\n\t\t\t\ttimestamp:\n\t\t\t\t\t(typeof pageJson.timestamp === 'string' ? new Date(pageJson.timestamp).toISOString() : pageJson.timestamp) ??\n\t\t\t\t\t(typeof jsonTemplate.timestamp === 'string' ? new Date(jsonTemplate.timestamp).toISOString() : jsonTemplate.timestamp) ??\n\t\t\t\t\tundefined,\n\t\t\t\tcolor: pageJson.color ?? jsonTemplate.color ?? undefined,\n\t\t\t\tfields: this.mergeArrays(jsonTemplate.fields, pageJson.fields),\n\t\t\t\tauthor: pageJson.author ?? jsonTemplate.author ?? undefined,\n\t\t\t\tthumbnail: pageJson.thumbnail ?? jsonTemplate.thumbnail ?? undefined,\n\t\t\t\timage: pageJson.image ?? jsonTemplate.image ?? undefined,\n\t\t\t\tvideo: pageJson.video ?? jsonTemplate.video ?? undefined,\n\t\t\t\tfooter: pageJson.footer ?? jsonTemplate.footer ?? undefined\n\t\t\t});\n\t\t}\n\n\t\treturn mergedEmbeds;\n\t}\n\n\t/**\n\t * Merges two arrays together.\n\t * @template T - The type of elements in the arrays.\n\t * @param {T[]} template - The first array to merge.\n\t * @param {T[]} array - The second array to merge.\n\t * @returns {undefined | T[]} - The merged array or undefined if both arrays are nullish.\n\t */\n\tprivate mergeArrays<T>(template?: T[], array?: T[]): undefined | T[] {\n\t\tif (isNullish(array)) {\n\t\t\treturn template;\n\t\t}\n\n\t\tif (isNullish(template)) {\n\t\t\treturn array;\n\t\t}\n\n\t\treturn [...template, ...array];\n\t}\n\n\t/**\n\t * Retrieves the PaginatedMessageAction associated with the provided customId and index.\n\t *\n\t * @param customId - The customId of the action.\n\t * @param index - The index of the action in the pageActions array.\n\t * @returns The PaginatedMessageAction associated with the customId and index, or undefined if not found.\n\t */\n\tprivate getAction(customId: string, index: number): PaginatedMessageAction | undefined {\n\t\tconst action = this.actions.get(customId);\n\t\tif (action) return action;\n\t\treturn this.pageActions.at(index)?.get(customId);\n\t}\n}\n\n/**\n * The `PaginatedMessage` interface represents a paginated message.\n */\nexport interface PaginatedMessage {\n\t/**\n\t * The `constructor` field represents the constructor of the `PaginatedMessage` interface.\n\t * It is of type `typeof PaginatedMessage`, which means it refers to the type of the `PaginatedMessage` interface itself.\n\t */\n\tconstructor: typeof PaginatedMessage;\n}\n","import { isFunction } from '@sapphire/utilities';\nimport { EmbedBuilder, Message, User } from 'discord.js';\nimport { MessageBuilder } from '../builders/MessageBuilder';\nimport type { AnyInteractableInteraction } from '../utility-types';\nimport { PaginatedMessage } from './PaginatedMessage';\nimport type { EmbedResolvable, PaginatedMessageResolvedPage } from './PaginatedMessageTypes';\n\n/**\n * This is a LazyPaginatedMessage. Instead of resolving all pages that are functions on {@link PaginatedMessage.run} will resolve when requested.\n */\nexport class LazyPaginatedMessage extends PaginatedMessage {\n\t/**\n\t * Only resolves the page corresponding with the handler's current index.\n\t */\n\tpublic override async resolvePagesOnRun(messageOrInteraction: Message | AnyInteractableInteraction, target: User): Promise<void> {\n\t\tawait this.resolvePage(messageOrInteraction, target, this.index);\n\t}\n\n\t/**\n\t * Resolves the page corresponding with the given index. This also resolves the index's before and after the given index.\n\t * @param messageOrInteraction The message or interaction that triggered this {@link LazyPaginatedMessage}.\n\t * @param target The user who will be able to interact with the buttons of this {@link LazyPaginatedMessage}.\n\t * @param index The index to resolve. Defaults to handler's current index.\n\t */\n\tpublic override async resolvePage(\n\t\tmessageOrInteraction: Message | AnyInteractableInteraction,\n\t\ttarget: User,\n\t\tindex: number\n\t): Promise<PaginatedMessageResolvedPage> {\n\t\tconst promises = [super.resolvePage(messageOrInteraction, target, index)];\n\t\tif (this.hasPage(index - 1)) promises.push(super.resolvePage(messageOrInteraction, target, index - 1));\n\t\tif (this.hasPage(index + 1)) promises.push(super.resolvePage(messageOrInteraction, target, index + 1));\n\n\t\tconst [result] = await Promise.all(promises);\n\t\treturn result;\n\t}\n\n\tpublic override addPageBuilder(builder: MessageBuilder | ((builder: MessageBuilder) => MessageBuilder)): this {\n\t\treturn this.addPage(() => (isFunction(builder) ? builder(new MessageBuilder()) : builder));\n\t}\n\n\tpublic override addPageContent(content: string): this {\n\t\treturn this.addPage(() => ({ content }));\n\t}\n\n\tpublic override addPageEmbed(embed: EmbedResolvable | ((builder: EmbedBuilder) => EmbedResolvable)): this {\n\t\treturn this.addPage(() => ({ embeds: typeof embed === 'function' ? [embed(new EmbedBuilder())] : [embed] }));\n\t}\n\n\tpublic override addPageEmbeds(\n\t\tembeds:\n\t\t\t| EmbedResolvable[]\n\t\t\t| ((\n\t\t\t\t\tembed1: EmbedBuilder,\n\t\t\t\t\tembed2: EmbedBuilder,\n\t\t\t\t\tembed3: EmbedBuilder,\n\t\t\t\t\tembed4: EmbedBuilder,\n\t\t\t\t\tembed5: EmbedBuilder,\n\t\t\t\t\tembed6: EmbedBuilder,\n\t\t\t\t\tembed7: EmbedBuilder,\n\t\t\t\t\tembed8: EmbedBuilder,\n\t\t\t\t\tembed9: EmbedBuilder,\n\t\t\t\t\tembed10: EmbedBuilder\n\t\t\t ) => EmbedResolvable[])\n\t): this {\n\t\treturn this.addPage(() => {\n\t\t\tlet processedEmbeds = isFunction(embeds)\n\t\t\t\t? embeds(\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder(),\n\t\t\t\t\t\tnew EmbedBuilder()\n\t\t\t\t\t)\n\t\t\t\t: embeds;\n\n\t\t\tif (processedEmbeds.length > 10) {\n\t\t\t\tprocessedEmbeds = processedEmbeds.slice(0, 10);\n\t\t\t}\n\n\t\t\treturn { embeds: processedEmbeds };\n\t\t});\n\t}\n}\n","import { isFunction, isNullish, isNullishOrEmpty } from '@sapphire/utilities';\nimport { EmbedBuilder, isJSONEncodable, type APIEmbed, type EmbedData } from 'discord.js';\nimport { PaginatedMessage } from './PaginatedMessage';\nimport type { EmbedResolvable } from './PaginatedMessageTypes';\n\n/**\n * This is a utility of {@link PaginatedMessage}, except it exclusively adds pagination inside a field of an embed.\n * You must either use this class directly or extend it.\n *\n * It differs from PaginatedMessageEmbedFields as the items here are the shape you want, and are then concatenated\n * in a single field with a given formatter function, whereas PaginatedMessageEmbedFields takes fields as the items\n * and add them to the embed.\n *\n * @example\n * ```typescript\n * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n *\n * new PaginatedFieldMessageEmbed()\n * .setTitleField('Test pager field')\n * .setTemplate({ embed })\n * .setItems([\n * { title: 'Sapphire Framework', value: 'discord.js Framework' },\n * { title: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n * { title: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n * ])\n * .formatItems((item) => `${item.title}\\n${item.value}`)\n * .setItemsPerPage(2)\n * .make()\n * .run(message);\n * ```\n */\nexport class PaginatedFieldMessageEmbed<T> extends PaginatedMessage {\n\t/**\n\t * The `embedTemplate` field represents the template for the embed message. It is of type `APIEmbed`.\n\t * It is initialized with a new `EmbedBuilder` instance converted to JSON.\n\t */\n\tprivate embedTemplate: APIEmbed = new EmbedBuilder().toJSON();\n\n\t/**\n\t * The `totalPages` field represents the total number of pages in the paginated message. It is of type `number`.\n\t * It is initialized to 0.\n\t */\n\tprivate totalPages: number = 0;\n\n\t/**\n\t * The `items` field represents the items to be displayed in the paginated message. It is an array of type `T`.\n\t * It is initialized to an empty array.\n\t */\n\tprivate items: T[] = [];\n\n\t/**\n\t * The `itemsPerPage` field represents the number of items to be displayed per page. It is of type `number`.\n\t * It is initialized to 10.\n\t */\n\tprivate itemsPerPage: number = 10;\n\n\t/**\n\t * The `fieldTitle` field represents the title of the field in the embed message. It is of type `string`.\n\t * It is initialized to an empty string.\n\t */\n\tprivate fieldTitle: string = '';\n\n\t/**\n\t * Set the items to paginate.\n\t * @param items The pages to set\n\t */\n\tpublic setItems(items: T[]) {\n\t\tthis.items = items;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Set the title of the embed field that will be used to paginate the items.\n\t * @param title The field title\n\t */\n\tpublic setTitleField(title: string) {\n\t\tthis.fieldTitle = title;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the amount of items that should be shown per page.\n\t * @param itemsPerPage The number of items\n\t */\n\tpublic setItemsPerPage(itemsPerPage: number) {\n\t\tthis.itemsPerPage = itemsPerPage;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the template to be used to display the embed fields as pages. This template can either be set from a template {@link EmbedBuilder} instance or an object with embed options.\n\t *\n\t * @param template EmbedBuilder\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n\t * import { EmbedBuilder } from 'discord.js';\n\t *\n\t * new PaginatedFieldMessageEmbed().setTemplate(new EmbedBuilder().setTitle('Test pager embed')).make().run(message);\n\t * ```\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedFieldMessageEmbed().setTemplate({ title: 'Test pager embed' }).make().run(message);\n\t * ```\n\t */\n\tpublic setTemplate(template: EmbedData | EmbedResolvable | ((embed: EmbedBuilder) => EmbedResolvable)) {\n\t\tthis.embedTemplate = this.resolveTemplate(template);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets a format callback that will be mapped to each embed field in the array of items when the embed is paginated. This should convert each item to a format that is either text itself or can be serialized as text.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedFieldMessageEmbed()\n\t * .setTitleField('Test field')\n\t * .setTemplate({ embed })\n\t * .setItems([\n\t * { title: 'Sapphire Framework', value: 'discord.js Framework' },\n\t * { title: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n\t * { title: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n\t * ])\n\t * .formatItems((item) => `${item.title}\\n${item.value}`)\n\t * .make()\n\t * .run(message);\n\t * ```\n\t * @param formatter The formatter callback to be applied to each embed item\n\t */\n\tpublic formatItems(formatter: (item: T, index: number, array: T[]) => any) {\n\t\tthis.items = this.items.map(formatter);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Build the pages of the given array.\n\t *\n\t * You must call the {@link PaginatedFieldMessageEmbed.make} and {@link PaginatedFieldMessageEmbed.run} methods last, in that order, for the pagination to work.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedFieldMessageEmbed } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedFieldMessageEmbed()\n\t * .setTitleField('Test field')\n\t * .setTemplate({ embed })\n\t * .setItems([\n\t * { title: 'Sapphire Framework', value: 'discord.js Framework' },\n\t * { title: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n\t * { title: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n\t * ])\n\t * .formatItems((item) => `${item.title}\\n${item.value}`)\n\t * .make()\n\t * .run(message);\n\t * ```\n\t */\n\tpublic make() {\n\t\tif (!this.fieldTitle.length) throw new Error('The title of the field to format must have a value.');\n\t\tif (!this.items.length) throw new Error('The items array is empty.');\n\t\tif (this.items.some((x) => !x)) throw new Error('The format of the array items is incorrect.');\n\n\t\tthis.totalPages = Math.ceil(this.items.length / this.itemsPerPage);\n\t\tthis.generatePages();\n\t\treturn this;\n\t}\n\n\t/**\n\t * Generates the pages for the paginated field message embed.\n\t * Each page contains a cloned template with modified fields and data.\n\t */\n\tprivate generatePages() {\n\t\tconst template = this.embedTemplate;\n\t\tfor (let i = 0; i < this.totalPages; i++) {\n\t\t\tconst clonedTemplate = new EmbedBuilder(template);\n\t\t\tconst fieldsClone = isNullishOrEmpty(template.fields) ? [] : [...template.fields];\n\t\t\tif (fieldsClone.length > 0) clonedTemplate.setFields();\n\t\t\tif (isNullish(template.color)) clonedTemplate.setColor('Random');\n\n\t\t\tconst data = this.paginateArray(this.items, i, this.itemsPerPage);\n\t\t\tthis.addPage({\n\t\t\t\tembeds: [clonedTemplate.addFields({ name: this.fieldTitle, value: data.join('\\n'), inline: false }, ...fieldsClone)]\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Paginates an array of items.\n\t *\n\t * @template T The type of items in the array.\n\t * @param items The array of items to paginate.\n\t * @param currentPage The current page number.\n\t * @param perPageItems The number of items per page.\n\t * @returns The paginated array of items.\n\t */\n\tprivate paginateArray(items: T[], currentPage: number, perPageItems: number) {\n\t\tconst offset = currentPage * perPageItems;\n\t\treturn items.slice(offset, offset + perPageItems);\n\t}\n\n\t/**\n\t * Resolves the template for the embed.\n\t *\n\t * @param template - The template for the embed. It can be an EmbedResolvable, EmbedData, or a function that takes an EmbedBuilder and returns an EmbedResolvable.\n\t * @returns The resolved APIEmbed object.\n\t */\n\tprivate resolveTemplate(template: EmbedResolvable | EmbedData | ((embed: EmbedBuilder) => EmbedResolvable)): APIEmbed {\n\t\tif (isFunction(template)) template = template(new EmbedBuilder());\n\t\treturn (isJSONEncodable(template) ? template : new EmbedBuilder(template)).toJSON();\n\t}\n}\n","import { EmbedLimits } from '@sapphire/discord-utilities';\nimport { isFunction, isNullishOrEmpty } from '@sapphire/utilities';\nimport { EmbedBuilder, isJSONEncodable, type APIEmbed, type EmbedData, type EmbedField } from 'discord.js';\nimport { PaginatedMessage } from './PaginatedMessage';\nimport type { EmbedResolvable } from './PaginatedMessageTypes';\n\n/**\n * This is a utility of {@link PaginatedMessage}, except it exclusively paginates the fields of an embed.\n * You must either use this class directly or extend it.\n *\n * It differs from PaginatedFieldMessageEmbed as the items here are whole fields, that are added to the embed,\n * whereas PaginatedFieldMessageEmbed concatenates the items in a single field with a given formatter function.\n *\n * @example\n * ```typescript\n * import { PaginatedMessageEmbedFields } from '@sapphire/discord.js-utilities';\n *\n * new PaginatedMessageEmbedFields()\n * \t.setTemplate({ title: 'Test pager embed', color: '#006080' })\n * \t.setItems([\n * \t\t{ name: 'Sapphire Framework', value: 'discord.js Framework' },\n * \t\t{ name: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n * \t\t{ name: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n * \t])\n * \t.setItemsPerPage(2)\n * \t.make()\n * \t.run(message);\n * ```\n */\nexport class PaginatedMessageEmbedFields extends PaginatedMessage {\n\t/**\n\t * The `embedTemplate` field represents the template for the embed message. It is of type `APIEmbed`.\n\t * It is initialized with a new `EmbedBuilder` instance converted to JSON.\n\t */\n\tprivate embedTemplate: APIEmbed = new EmbedBuilder().toJSON();\n\n\t/**\n\t * The `totalPages` field represents the total number of pages in the paginated message. It is of type `number`.\n\t * It is initialized to 0.\n\t */\n\tprivate totalPages: number = 0;\n\n\t/**\n\t * The array of embed fields in the PaginatedMessageEmbedFields class.\n\t */\n\tprivate items: EmbedField[] = [];\n\n\t/**\n\t * The `itemsPerPage` field represents the number of items to be displayed per page. It is of type `number`.\n\t * It is initialized to 10.\n\t */\n\tprivate itemsPerPage: number = 10;\n\n\t/**\n\t * Set the items to paginate.\n\t * @param items The pages to set\n\t */\n\tpublic setItems(items: EmbedField[]): this {\n\t\tthis.items = items;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the amount of items that should be shown per page.\n\t * @param itemsPerPage The number of items\n\t */\n\tpublic setItemsPerPage(itemsPerPage: number): this {\n\t\tthis.itemsPerPage = itemsPerPage;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the template to be used to display the embed fields as pages. This template can either be set from a template {@link MessageEmbed} instance or an object with embed options.\n\t * All fields in the given template will be overwritten when calling {@link PaginatedMessageEmbedFields.make}.\n\t *\n\t * @param template MessageEmbed\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessageEmbedFields } from '@sapphire/discord.js-utilities';\n\t * import { EmbedBuilder } from 'discord.js';\n\t *\n\t * new PaginatedMessageEmbedFields()\n\t * \t.setTemplate(new EmbedBuilder().setColor('#006080').setTitle('Test pager embed'))\n\t * \t.setItems([{ name: 'My field', value: 'The field\\'s value' }])\n\t * \t.make()\n\t * \t.run(message);\n\t * ```\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessageEmbedFields } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedMessageEmbedFields()\n\t * \t.setTemplate({ title: 'Test pager embed', color: '#006080' })\n\t * \t.setItems([{ name: 'My field', value: 'The field\\'s value' }])\n\t * \t.make()\n\t * \t.run(message);\n\t * ```\n\t */\n\tpublic setTemplate(template: EmbedResolvable | ((embed: EmbedBuilder) => EmbedResolvable)): this {\n\t\tthis.embedTemplate = this.resolveTemplate(template);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Build the pages of the given array.\n\t *\n\t * You must call the [[PaginatedMessageEmbedFields.make]] and [[PaginatedMessageEmbedFields.run]] methods last, in that order, for the pagination to work.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { PaginatedMessageEmbedFields } from '@sapphire/discord.js-utilities';\n\t *\n\t * new PaginatedMessageEmbedFields()\n\t * \t.setItems([\n\t * \t\t{ name: 'Sapphire Framework', value: 'discord.js Framework' },\n\t * \t\t{ name: 'Sapphire Framework 2', value: 'discord.js Framework 2' },\n\t * \t\t{ name: 'Sapphire Framework 3', value: 'discord.js Framework 3' }\n\t * \t])\n\t * \t.setItemsPerPage(3)\n\t * \t.make()\n\t * \t.run(message);\n\t * ```\n\t */\n\tpublic make(): this {\n\t\tif (!this.items.length) throw new Error('The items array is empty.');\n\t\tif (this.itemsPerPage > EmbedLimits.MaximumFields) throw new Error(`Pages cannot contain more than ${EmbedLimits.MaximumFields} fields.`);\n\n\t\tthis.totalPages = Math.ceil(this.items.length / this.itemsPerPage);\n\t\tthis.generatePages();\n\t\treturn this;\n\t}\n\n\t/**\n\t * Generates the pages for the paginated message.\n\t * It clones the embed template, sets the fields, color, and adds the data to each page.\n\t */\n\tprivate generatePages(): void {\n\t\tconst template = this.embedTemplate;\n\t\tfor (let i = 0; i < this.totalPages; i++) {\n\t\t\tconst clonedTemplate = new EmbedBuilder(template);\n\t\t\tconst fieldsClone = isNullishOrEmpty(template.fields) ? [] : [...template.fields];\n\t\t\tif (fieldsClone.length > 0) clonedTemplate.setFields();\n\n\t\t\tif (!clonedTemplate.data.color) clonedTemplate.setColor('Random');\n\n\t\t\tconst data = this.paginateArray(this.items, i, this.itemsPerPage - fieldsClone.length);\n\t\t\tthis.addPage({\n\t\t\t\tembeds: [clonedTemplate.addFields(...data, ...fieldsClone)]\n\t\t\t});\n\t\t}\n\t}\n\n\t/**\n\t * Paginates an array of EmbedFields.\n\t *\n\t * @param items - The array of EmbedFields to paginate.\n\t * @param currentPage - The current page number.\n\t * @param perPageItems - The number of items per page.\n\t * @returns The paginated array of EmbedFields.\n\t */\n\tprivate paginateArray(items: EmbedField[], currentPage: number, perPageItems: number): EmbedField[] {\n\t\tconst offset = currentPage * perPageItems;\n\t\treturn items.slice(offset, offset + perPageItems);\n\t}\n\n\t/**\n\t * Resolves the template for the PaginatedMessageEmbedFields.\n\t *\n\t * @param template - The template to resolve. It can be an EmbedResolvable, EmbedData, or a function that takes an EmbedBuilder and returns an EmbedResolvable.\n\t * @returns The resolved APIEmbed object.\n\t */\n\tprivate resolveTemplate(template: EmbedResolvable | EmbedData | ((embed: EmbedBuilder) => EmbedResolvable)): APIEmbed {\n\t\tif (isFunction(template)) template = template(new EmbedBuilder());\n\t\treturn (isJSONEncodable(template) ? template : new EmbedBuilder(template)).toJSON();\n\t}\n}\n","import { isNullish, type Nullish } from '@sapphire/utilities';\nimport { PermissionFlagsBits, PermissionsBitField, type VoiceBasedChannel } from 'discord.js';\nimport { isDMChannel, isGuildBasedChannel, isVoiceBasedChannel } from './type-guards';\nimport type { ChannelTypes } from './utility-types';\n\nconst canReadMessagesPermissions = new PermissionsBitField([PermissionFlagsBits.ViewChannel]);\n\n/**\n * Determines whether or not we can read messages in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can read messages in the specified channel.\n */\nexport function canReadMessages(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\n\treturn canDoUtility(channel, canReadMessagesPermissions);\n}\n\nconst canSendMessagesPermissions = new PermissionsBitField([canReadMessagesPermissions, PermissionFlagsBits.SendMessages]);\n\n/**\n * Determines whether or not we can send messages in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can send messages in the specified channel.\n */\nexport function canSendMessages(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\tif (channel.isThread() && !channel.sendable) return false;\n\n\treturn canDoUtility(channel, canSendMessagesPermissions);\n}\n\nconst canSendEmbedsPermissions = new PermissionsBitField([canSendMessagesPermissions, PermissionFlagsBits.EmbedLinks]);\n\n/**\n * Determines whether or not we can send embeds in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can send embeds in the specified channel.\n */\nexport function canSendEmbeds(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\tif (channel.isThread() && !channel.sendable) return false;\n\n\treturn canDoUtility(channel, canSendEmbedsPermissions);\n}\n\nconst canSendAttachmentsPermissions = new PermissionsBitField([canSendMessagesPermissions, PermissionFlagsBits.AttachFiles]);\n\n/**\n * Determines whether or not we can send attachments in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can send attachments in the specified channel.\n */\nexport function canSendAttachments(channel: ChannelTypes | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\tif (channel.isThread() && !channel.sendable) return false;\n\n\treturn canDoUtility(channel, canSendAttachmentsPermissions);\n}\n\nconst canReactPermissions = new PermissionsBitField([\n\tcanSendMessagesPermissions,\n\tPermissionFlagsBits.ReadMessageHistory,\n\tPermissionFlagsBits.AddReactions\n]);\n\n/**\n * Determines whether or not we can send react to messages in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can react to messages in the specified channel.\n */\nexport function canReact(channel: ChannelTypes | Nullish) {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return true;\n\tif (channel.isThread() && channel.archived) return false;\n\n\treturn canDoUtility(channel, canReactPermissions);\n}\n\nconst canRemoveAllReactionsPermissions = new PermissionsBitField([\n\tcanReadMessagesPermissions,\n\tPermissionFlagsBits.ReadMessageHistory,\n\tPermissionFlagsBits.ManageMessages\n]);\n\n/**\n * Determines whether or not we can remove reactions from messages in a given channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not we can remove reactions from messages in the specified channel.\n */\nexport function canRemoveAllReactions(channel: ChannelTypes | Nullish) {\n\tif (isNullish(channel)) return false;\n\tif (isDMChannel(channel)) return false;\n\n\treturn canDoUtility(channel, canRemoveAllReactionsPermissions);\n}\n\nconst canJoinVoiceChannelPermissions = new PermissionsBitField([PermissionFlagsBits.Connect]);\n\n/**\n * Determines whether the client can join the given voice based channel.\n * @param channel The channel to test the permissions from.\n * @returns Whether or not the client can join the specified channel.\n */\nexport function canJoinVoiceChannel(channel: VoiceBasedChannel | Nullish): boolean {\n\tif (isNullish(channel)) return false;\n\tif (!isVoiceBasedChannel(channel)) return false;\n\tif (channel.userLimit >= channel.members.size) return false;\n\n\treturn canDoUtility(channel, canJoinVoiceChannelPermissions);\n}\n\nfunction canDoUtility(channel: ChannelTypes, permissionsToPass: PermissionsBitField) {\n\tif (!isGuildBasedChannel(channel)) {\n\t\treturn true;\n\t}\n\n\tconst { me } = channel.guild.members;\n\tif (!me) return false;\n\n\tconst permissionsFor = channel.permissionsFor(me);\n\tif (!permissionsFor) return false;\n\n\treturn permissionsFor.has(permissionsToPass);\n}\n"]}