@sapphire/discord.js-utilities 7.3.3-next.ff2c792d → 7.3.3

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,5 +1,5 @@
1
1
  export * from '@sapphire/discord-utilities';
2
- import { MessageCreateOptions, CategoryChannel, DMChannel, DirectoryChannel, PartialDMChannel, NewsChannel, StageChannel, TextChannel, ThreadChannel, VoiceChannel, GuildChannel, Channel, Message, ChatInputCommandInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, AutocompleteInteraction, StringSelectMenuInteraction, ButtonInteraction, Interaction, PartialTextBasedChannelFields, EmojiIdentifierResolvable, User, CollectorFilter, MessageReaction, CollectorOptions, GuildEmoji, ReactionEmoji, ApplicationEmoji, EmojiResolvable, InteractionButtonComponentData, LinkButtonComponentData, StringSelectMenuComponentData, UserSelectMenuComponentData, RoleSelectMenuComponentData, MentionableSelectMenuComponentData, ChannelSelectMenuComponentData, APIMessage, CommandInteraction, InteractionCollector, EmbedBuilder, BaseMessageOptions, WebhookMessageEditOptions, SelectMenuComponentOptionData, MessageComponentInteraction, APIEmbed, JSONEncodable, CollectedInteraction, ModalSubmitInteraction, APIActionRowComponent, APIMessageActionRowComponent, ActionRowData, ActionRowComponentOptions, MessageActionRowComponentBuilder, Guild, InteractionReplyOptions, InteractionUpdateOptions, MessageReplyOptions, MessageEditOptions, Collection, Snowflake, EmbedData, EmbedField, ButtonComponentData, ButtonBuilder, PartialGroupDMChannel, PublicThreadChannel, PrivateThreadChannel, VoiceBasedChannel, BaseInteraction, GuildMember, APIGuildMember, APIInteractionGuildMember, APIInteractionDataResolvedGuildMember, Attachment } from 'discord.js';
2
+ import { Interaction, AutocompleteInteraction, CategoryChannel, DMChannel, DirectoryChannel, PartialDMChannel, NewsChannel, StageChannel, TextChannel, ThreadChannel, VoiceChannel, GuildChannel, Channel, ChatInputCommandInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, JSONEncodable, APIEmbed, Message, EmojiIdentifierResolvable, GuildEmoji, ReactionEmoji, ApplicationEmoji, PartialTextBasedChannelFields, User, CollectorFilter, MessageReaction, CollectorOptions, InteractionButtonComponentData, CollectedInteraction, ModalSubmitInteraction, APIMessage, CommandInteraction, ButtonInteraction, InteractionCollector, LinkButtonComponentData, StringSelectMenuComponentData, UserSelectMenuComponentData, RoleSelectMenuComponentData, MentionableSelectMenuComponentData, ChannelSelectMenuComponentData, Guild, SelectMenuComponentOptionData, MessageComponentInteraction, BaseMessageOptions, WebhookMessageEditOptions, EmbedBuilder, MessageCreateOptions, MessageActionRowComponentBuilder, Collection, Snowflake, EmojiResolvable, StringSelectMenuInteraction, EmbedData, APIActionRowComponent, APIComponentInMessageActionRow, ActionRowData, ActionRowComponentOptions, EmbedField, InteractionReplyOptions, InteractionUpdateOptions, MessageReplyOptions, MessageEditOptions, VoiceBasedChannel, BaseInteraction, ButtonBuilder, PartialGroupDMChannel, GuildMember, APIGuildMember, APIInteractionGuildMember, APIInteractionDataResolvedGuildMember, Attachment, ButtonComponentData, PublicThreadChannel, PrivateThreadChannel } from 'discord.js';
3
3
  import { ArgumentTypes, Awaitable, Ctor, Nullish } from '@sapphire/utilities';
4
4
 
5
5
  type MessageBuilderFileResolvable = NonNullable<MessageCreateOptions['files']>[number];
@@ -643,7 +643,7 @@ type PaginatedMessagePage = ((index: number, pages: PaginatedMessagePage[], hand
643
643
  * It can be either a `BaseMessageOptions` object with the `flags` property omitted,
644
644
  * or a `WebhookMessageEditOptions` object.
645
645
  */
646
- type PaginatedMessageResolvedPage = Omit<BaseMessageOptions, 'flags'> | WebhookMessageEditOptions;
646
+ type PaginatedMessageResolvedPage = Omit<BaseMessageOptions, 'flags'> | Omit<WebhookMessageEditOptions, 'flags'>;
647
647
  /**
648
648
  * The type of the custom function that can be set for the {@link PaginatedMessage.selectMenuOptions}
649
649
  */
@@ -677,11 +677,11 @@ type PaginatedMessageInteractionUnion = Exclude<CollectedInteraction, ModalSubmi
677
677
  /**
678
678
  * Represents a union type for components in a paginated message.
679
679
  * It can be one of the following types:
680
- * - `JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>>`
680
+ * - `JSONEncodable<APIActionRowComponent<APIComponentInMessageActionRow>>`
681
681
  * - `ActionRowData<ActionRowComponentOptions | MessageActionRowComponentBuilder>`
682
- * - `APIActionRowComponent<APIMessageActionRowComponent>`
682
+ * - `APIActionRowComponent<APIComponentInMessageActionRow>`
683
683
  */
684
- type PaginatedMessageComponentUnion = JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<ActionRowComponentOptions | MessageActionRowComponentBuilder> | APIActionRowComponent<APIMessageActionRowComponent>;
684
+ type PaginatedMessageComponentUnion = JSONEncodable<APIActionRowComponent<APIComponentInMessageActionRow>> | ActionRowData<ActionRowComponentOptions | MessageActionRowComponentBuilder> | APIActionRowComponent<APIComponentInMessageActionRow>;
685
685
  /**
686
686
  * @internal This is a duplicate of the same interface in `@sapphire/plugin-i18next`
687
687
  * Duplicated here for the type of the parameters in the functions
@@ -926,7 +926,7 @@ declare class PaginatedMessage {
926
926
  * 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.
927
927
  * Furthermore, we also recommend setting `allowedMentions: { users: [], roles: [] }`, so you don't have to worry about accidentally pinging anyone.
928
928
  *
929
- * When setting just a string, we will add `{ ephemeral: true, allowedMentions: { users: [], roles: [] } }` for you.
929
+ * When setting just a string, we will add `{ flags: MessageFlags.Ephemeral, allowedMentions: { users: [], roles: [] } }` for you.
930
930
  *
931
931
  * @param targetUser The {@link User} this {@link PaginatedMessage} was intended for.
932
932
  * @param interactionUser The {@link User} that actually clicked the button.
@@ -936,7 +936,7 @@ declare class PaginatedMessage {
936
936
  *
937
937
  * {
938
938
  * content: `Please stop interacting with the components on this message. They are only for ${userMention(targetUser.id)}.`,
939
- * ephemeral: true,
939
+ * flags: MessageFlags.Ephemeral,
940
940
  * allowedMentions: { users: [], roles: [] }
941
941
  * }
942
942
  * ```
@@ -961,7 +961,7 @@ declare class PaginatedMessage {
961
961
  * content: `These buttons are only for ${userMention(
962
962
  * targetUser.id
963
963
  * )}. Press them as much as you want, but I won't do anything with your clicks.`,
964
- * ephemeral: true,
964
+ * flags: MessageFlags.Ephemeral,
965
965
  * allowedMentions: { users: [], roles: [] }
966
966
  * });
967
967
  * ```
@@ -2090,7 +2090,7 @@ declare function isActionChannelMenu(action: PaginatedMessageAction): action is
2090
2090
  /**
2091
2091
  * Creates partitioned message rows based on the provided components.
2092
2092
  * @param components The array of MessageActionRowComponentBuilder objects.
2093
- * @returns An array of `APIActionRowComponent<APIMessageActionRowComponent>` objects.
2093
+ * @returns An array of `APIActionRowComponent<APIComponentInMessageActionRow>` objects.
2094
2094
  */
2095
2095
  declare function createPartitionedMessageRow(components: MessageActionRowComponentBuilder[]): PaginatedMessageComponentUnion[];
2096
2096
  /**
@@ -1,5 +1,5 @@
1
1
  export * from '@sapphire/discord-utilities';
2
- import { MessageCreateOptions, CategoryChannel, DMChannel, DirectoryChannel, PartialDMChannel, NewsChannel, StageChannel, TextChannel, ThreadChannel, VoiceChannel, GuildChannel, Channel, Message, ChatInputCommandInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, AutocompleteInteraction, StringSelectMenuInteraction, ButtonInteraction, Interaction, PartialTextBasedChannelFields, EmojiIdentifierResolvable, User, CollectorFilter, MessageReaction, CollectorOptions, GuildEmoji, ReactionEmoji, ApplicationEmoji, EmojiResolvable, InteractionButtonComponentData, LinkButtonComponentData, StringSelectMenuComponentData, UserSelectMenuComponentData, RoleSelectMenuComponentData, MentionableSelectMenuComponentData, ChannelSelectMenuComponentData, APIMessage, CommandInteraction, InteractionCollector, EmbedBuilder, BaseMessageOptions, WebhookMessageEditOptions, SelectMenuComponentOptionData, MessageComponentInteraction, APIEmbed, JSONEncodable, CollectedInteraction, ModalSubmitInteraction, APIActionRowComponent, APIMessageActionRowComponent, ActionRowData, ActionRowComponentOptions, MessageActionRowComponentBuilder, Guild, InteractionReplyOptions, InteractionUpdateOptions, MessageReplyOptions, MessageEditOptions, Collection, Snowflake, EmbedData, EmbedField, ButtonComponentData, ButtonBuilder, PartialGroupDMChannel, PublicThreadChannel, PrivateThreadChannel, VoiceBasedChannel, BaseInteraction, GuildMember, APIGuildMember, APIInteractionGuildMember, APIInteractionDataResolvedGuildMember, Attachment } from 'discord.js';
2
+ import { Interaction, AutocompleteInteraction, CategoryChannel, DMChannel, DirectoryChannel, PartialDMChannel, NewsChannel, StageChannel, TextChannel, ThreadChannel, VoiceChannel, GuildChannel, Channel, ChatInputCommandInteraction, UserContextMenuCommandInteraction, MessageContextMenuCommandInteraction, JSONEncodable, APIEmbed, Message, EmojiIdentifierResolvable, GuildEmoji, ReactionEmoji, ApplicationEmoji, PartialTextBasedChannelFields, User, CollectorFilter, MessageReaction, CollectorOptions, InteractionButtonComponentData, CollectedInteraction, ModalSubmitInteraction, APIMessage, CommandInteraction, ButtonInteraction, InteractionCollector, LinkButtonComponentData, StringSelectMenuComponentData, UserSelectMenuComponentData, RoleSelectMenuComponentData, MentionableSelectMenuComponentData, ChannelSelectMenuComponentData, Guild, SelectMenuComponentOptionData, MessageComponentInteraction, BaseMessageOptions, WebhookMessageEditOptions, EmbedBuilder, MessageCreateOptions, MessageActionRowComponentBuilder, Collection, Snowflake, EmojiResolvable, StringSelectMenuInteraction, EmbedData, APIActionRowComponent, APIComponentInMessageActionRow, ActionRowData, ActionRowComponentOptions, EmbedField, InteractionReplyOptions, InteractionUpdateOptions, MessageReplyOptions, MessageEditOptions, VoiceBasedChannel, BaseInteraction, ButtonBuilder, PartialGroupDMChannel, GuildMember, APIGuildMember, APIInteractionGuildMember, APIInteractionDataResolvedGuildMember, Attachment, ButtonComponentData, PublicThreadChannel, PrivateThreadChannel } from 'discord.js';
3
3
  import { ArgumentTypes, Awaitable, Ctor, Nullish } from '@sapphire/utilities';
4
4
 
5
5
  type MessageBuilderFileResolvable = NonNullable<MessageCreateOptions['files']>[number];
@@ -643,7 +643,7 @@ type PaginatedMessagePage = ((index: number, pages: PaginatedMessagePage[], hand
643
643
  * It can be either a `BaseMessageOptions` object with the `flags` property omitted,
644
644
  * or a `WebhookMessageEditOptions` object.
645
645
  */
646
- type PaginatedMessageResolvedPage = Omit<BaseMessageOptions, 'flags'> | WebhookMessageEditOptions;
646
+ type PaginatedMessageResolvedPage = Omit<BaseMessageOptions, 'flags'> | Omit<WebhookMessageEditOptions, 'flags'>;
647
647
  /**
648
648
  * The type of the custom function that can be set for the {@link PaginatedMessage.selectMenuOptions}
649
649
  */
@@ -677,11 +677,11 @@ type PaginatedMessageInteractionUnion = Exclude<CollectedInteraction, ModalSubmi
677
677
  /**
678
678
  * Represents a union type for components in a paginated message.
679
679
  * It can be one of the following types:
680
- * - `JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>>`
680
+ * - `JSONEncodable<APIActionRowComponent<APIComponentInMessageActionRow>>`
681
681
  * - `ActionRowData<ActionRowComponentOptions | MessageActionRowComponentBuilder>`
682
- * - `APIActionRowComponent<APIMessageActionRowComponent>`
682
+ * - `APIActionRowComponent<APIComponentInMessageActionRow>`
683
683
  */
684
- type PaginatedMessageComponentUnion = JSONEncodable<APIActionRowComponent<APIMessageActionRowComponent>> | ActionRowData<ActionRowComponentOptions | MessageActionRowComponentBuilder> | APIActionRowComponent<APIMessageActionRowComponent>;
684
+ type PaginatedMessageComponentUnion = JSONEncodable<APIActionRowComponent<APIComponentInMessageActionRow>> | ActionRowData<ActionRowComponentOptions | MessageActionRowComponentBuilder> | APIActionRowComponent<APIComponentInMessageActionRow>;
685
685
  /**
686
686
  * @internal This is a duplicate of the same interface in `@sapphire/plugin-i18next`
687
687
  * Duplicated here for the type of the parameters in the functions
@@ -926,7 +926,7 @@ declare class PaginatedMessage {
926
926
  * 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.
927
927
  * Furthermore, we also recommend setting `allowedMentions: { users: [], roles: [] }`, so you don't have to worry about accidentally pinging anyone.
928
928
  *
929
- * When setting just a string, we will add `{ ephemeral: true, allowedMentions: { users: [], roles: [] } }` for you.
929
+ * When setting just a string, we will add `{ flags: MessageFlags.Ephemeral, allowedMentions: { users: [], roles: [] } }` for you.
930
930
  *
931
931
  * @param targetUser The {@link User} this {@link PaginatedMessage} was intended for.
932
932
  * @param interactionUser The {@link User} that actually clicked the button.
@@ -936,7 +936,7 @@ declare class PaginatedMessage {
936
936
  *
937
937
  * {
938
938
  * content: `Please stop interacting with the components on this message. They are only for ${userMention(targetUser.id)}.`,
939
- * ephemeral: true,
939
+ * flags: MessageFlags.Ephemeral,
940
940
  * allowedMentions: { users: [], roles: [] }
941
941
  * }
942
942
  * ```
@@ -961,7 +961,7 @@ declare class PaginatedMessage {
961
961
  * content: `These buttons are only for ${userMention(
962
962
  * targetUser.id
963
963
  * )}. Press them as much as you want, but I won't do anything with your clicks.`,
964
- * ephemeral: true,
964
+ * flags: MessageFlags.Ephemeral,
965
965
  * allowedMentions: { users: [], roles: [] }
966
966
  * });
967
967
  * ```
@@ -2090,7 +2090,7 @@ declare function isActionChannelMenu(action: PaginatedMessageAction): action is
2090
2090
  /**
2091
2091
  * Creates partitioned message rows based on the provided components.
2092
2092
  * @param components The array of MessageActionRowComponentBuilder objects.
2093
- * @returns An array of `APIActionRowComponent<APIMessageActionRowComponent>` objects.
2093
+ * @returns An array of `APIActionRowComponent<APIComponentInMessageActionRow>` objects.
2094
2094
  */
2095
2095
  declare function createPartitionedMessageRow(components: MessageActionRowComponentBuilder[]): PaginatedMessageComponentUnion[];
2096
2096
  /**
@@ -1,7 +1,7 @@
1
1
  import { EmbedLimits } from '@sapphire/discord-utilities';
2
2
  export * from '@sapphire/discord-utilities';
3
- import { isNullish, isNullishOrEmpty, isNullishOrZero, partition, chunk, isFunction, deepClone, isObject } from '@sapphire/utilities';
4
- import { ComponentType, ButtonStyle, PermissionsBitField, PermissionFlagsBits, ChannelType, Message, BaseInteraction, GuildMember, ActionRowBuilder, isJSONEncodable, EmbedBuilder, Partials, IntentsBitField, GatewayIntentBits, InteractionCollector, InteractionType, ButtonBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, StringSelectMenuBuilder, userMention } from 'discord.js';
3
+ import { isFunction, isNullish, deepClone, isObject, partition, chunk, isNullishOrEmpty, isNullishOrZero } from '@sapphire/utilities';
4
+ import { ComponentType, ButtonStyle, PermissionsBitField, PermissionFlagsBits, isJSONEncodable, EmbedBuilder, Partials, IntentsBitField, GatewayIntentBits, MessageFlags, InteractionCollector, InteractionType, ButtonBuilder, UserSelectMenuBuilder, RoleSelectMenuBuilder, MentionableSelectMenuBuilder, ChannelSelectMenuBuilder, StringSelectMenuBuilder, BaseInteraction, ActionRowBuilder, Message, ChannelType, GuildMember, userMention } from 'discord.js';
5
5
  import { Time } from '@sapphire/duration';
6
6
 
7
7
  var __defProp = Object.defineProperty;
@@ -1506,7 +1506,7 @@ var _PaginatedMessage = class _PaginatedMessage {
1506
1506
  await safelyReplyToInteraction({
1507
1507
  messageOrInteraction,
1508
1508
  interactionEditReplyContent: __privateGet(this, _thisMazeWasNotMeantForYouContent),
1509
- interactionReplyContent: { ...__privateGet(this, _thisMazeWasNotMeantForYouContent), ephemeral: true },
1509
+ interactionReplyContent: { ...__privateGet(this, _thisMazeWasNotMeantForYouContent), flags: MessageFlags.Ephemeral },
1510
1510
  componentUpdateContent: __privateGet(this, _thisMazeWasNotMeantForYouContent),
1511
1511
  messageMethod: "reply",
1512
1512
  messageMethodContent: __privateGet(this, _thisMazeWasNotMeantForYouContent)
@@ -1751,7 +1751,7 @@ var _PaginatedMessage = class _PaginatedMessage {
1751
1751
  await safelyReplyToInteraction({
1752
1752
  messageOrInteraction: interaction,
1753
1753
  interactionEditReplyContent: updateOptions,
1754
- interactionReplyContent: { ...__privateGet(this, _thisMazeWasNotMeantForYouContent), ephemeral: true },
1754
+ interactionReplyContent: { ...__privateGet(this, _thisMazeWasNotMeantForYouContent), flags: MessageFlags.Ephemeral },
1755
1755
  componentUpdateContent: updateOptions
1756
1756
  });
1757
1757
  }
@@ -1763,7 +1763,7 @@ var _PaginatedMessage = class _PaginatedMessage {
1763
1763
  this.resolvePaginatedMessageInternationalizationContext(interaction, targetUser)
1764
1764
  );
1765
1765
  await interaction.reply(
1766
- isObject(interactionReplyOptions) ? interactionReplyOptions : { content: interactionReplyOptions, ephemeral: true, allowedMentions: { users: [], roles: [] } }
1766
+ isObject(interactionReplyOptions) ? interactionReplyOptions : { content: interactionReplyOptions, flags: MessageFlags.Ephemeral, allowedMentions: { users: [], roles: [] } }
1767
1767
  );
1768
1768
  }
1769
1769
  }
@@ -1780,7 +1780,7 @@ var _PaginatedMessage = class _PaginatedMessage {
1780
1780
  void safelyReplyToInteraction({
1781
1781
  messageOrInteraction: this.response,
1782
1782
  interactionEditReplyContent: { components: [] },
1783
- interactionReplyContent: { ...__privateGet(this, _thisMazeWasNotMeantForYouContent), ephemeral: true },
1783
+ interactionReplyContent: { ...__privateGet(this, _thisMazeWasNotMeantForYouContent), flags: MessageFlags.Ephemeral },
1784
1784
  componentUpdateContent: { components: [] },
1785
1785
  messageMethod: "edit",
1786
1786
  messageMethodContent: { components: [] }
@@ -2082,7 +2082,7 @@ __publicField(_PaginatedMessage, "selectMenuOptions", /* @__PURE__ */ __name((pa
2082
2082
  * 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.
2083
2083
  * Furthermore, we also recommend setting `allowedMentions: { users: [], roles: [] }`, so you don't have to worry about accidentally pinging anyone.
2084
2084
  *
2085
- * When setting just a string, we will add `{ ephemeral: true, allowedMentions: { users: [], roles: [] } }` for you.
2085
+ * When setting just a string, we will add `{ flags: MessageFlags.Ephemeral, allowedMentions: { users: [], roles: [] } }` for you.
2086
2086
  *
2087
2087
  * @param targetUser The {@link User} this {@link PaginatedMessage} was intended for.
2088
2088
  * @param interactionUser The {@link User} that actually clicked the button.
@@ -2092,7 +2092,7 @@ __publicField(_PaginatedMessage, "selectMenuOptions", /* @__PURE__ */ __name((pa
2092
2092
  *
2093
2093
  * {
2094
2094
  * content: `Please stop interacting with the components on this message. They are only for ${userMention(targetUser.id)}.`,
2095
- * ephemeral: true,
2095
+ * flags: MessageFlags.Ephemeral,
2096
2096
  * allowedMentions: { users: [], roles: [] }
2097
2097
  * }
2098
2098
  * ```
@@ -2117,14 +2117,14 @@ __publicField(_PaginatedMessage, "selectMenuOptions", /* @__PURE__ */ __name((pa
2117
2117
  * content: `These buttons are only for ${userMention(
2118
2118
  * targetUser.id
2119
2119
  * )}. Press them as much as you want, but I won't do anything with your clicks.`,
2120
- * ephemeral: true,
2120
+ * flags: MessageFlags.Ephemeral,
2121
2121
  * allowedMentions: { users: [], roles: [] }
2122
2122
  * });
2123
2123
  * ```
2124
2124
  */
2125
2125
  __publicField(_PaginatedMessage, "wrongUserInteractionReply", /* @__PURE__ */ __name((targetUser) => ({
2126
2126
  content: `Please stop interacting with the components on this message. They are only for ${userMention(targetUser.id)}.`,
2127
- ephemeral: true,
2127
+ flags: MessageFlags.Ephemeral,
2128
2128
  allowedMentions: { users: [], roles: [] }
2129
2129
  }), "wrongUserInteractionReply"));
2130
2130
  var PaginatedMessage = _PaginatedMessage;