Skip to main content

Module: discord.js-utilities/src

Classes

Interfaces

Type Aliases

ChannelTypeString

Ƭ ChannelTypeString: ChannelTypes["type"] | "UNKNOWN"

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utility-types.ts:65


ChannelTypes

Ƭ ChannelTypes: CategoryChannel | DMChannel | PartialDMChannel | NewsChannel | StageChannel | StoreChannel | TextChannel | ThreadChannel | VoiceChannel | GuildChannel | Channel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utility-types.ts:19


GuildBasedChannelTypes

Ƭ GuildBasedChannelTypes: NonThreadGuildBasedChannelTypes | ThreadChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utility-types.ts:50


GuildTextBasedChannelTypes

Ƭ GuildTextBasedChannelTypes: NonThreadGuildTextBasedChannelTypes | ThreadChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utility-types.ts:60


MessageBuilderFileResolvable

Ƭ MessageBuilderFileResolvable: NonNullable<MessageOptions["files"]>[number]

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/builders/MessageBuilder.ts:3


MessageBuilderResolvable

Ƭ MessageBuilderResolvable: Omit<MessageOptions, "embed" | "disableMentions" | "reply"> & { embeds?: MessageOptions["embeds"] }

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/builders/MessageBuilder.ts:4


MessagePrompterChannelTypes

Ƭ MessagePrompterChannelTypes: Exclude<ChannelTypes, VoiceBasedChannelTypes | StoreChannel | CategoryChannel>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/constants.ts:10


MessagePrompterMessage

Ƭ MessagePrompterMessage: Omit<ArgumentTypes<PartialTextBasedChannelFields["send"]>[0], "flags">

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/MessagePrompter/constants.ts:8


NonThreadGuildBasedChannelTypes

Ƭ NonThreadGuildBasedChannelTypes: Extract<ChannelTypes, GuildChannel>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utility-types.ts:45


NonThreadGuildTextBasedChannelTypes

Ƭ NonThreadGuildTextBasedChannelTypes: Extract<TextBasedChannelTypes, GuildChannel>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utility-types.ts:55


PaginatedMessageAction

Ƭ PaginatedMessageAction: PaginatedMessageActionButton | PaginatedMessageActionLink | PaginatedMessageActionMenu

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/PaginatedMessageTypes.ts:33


PaginatedMessageEmbedResolvable

Ƭ PaginatedMessageEmbedResolvable: MessageOptions["embeds"]

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/PaginatedMessageTypes.ts:169


PaginatedMessageMessageOptionsUnion

Ƭ PaginatedMessageMessageOptionsUnion: Omit<MessageOptions, "flags"> | WebhookEditMessageOptions

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/PaginatedMessageTypes.ts:171


PaginatedMessagePage

Ƭ PaginatedMessagePage: (index: number, pages: PaginatedMessagePage[], handler: PaginatedMessage) => Awaitable<PaginatedMessageMessageOptionsUnion> | PaginatedMessageMessageOptionsUnion

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/PaginatedMessageTypes.ts:148


PaginatedMessageSelectMenuOptionsFunction

Ƭ PaginatedMessageSelectMenuOptionsFunction: (pageIndex: number, internationalizationContext: PaginatedMessageInternationalizationContext) => Awaitable<Omit<MessageSelectOptionData, "value">>

Type declaration

▸ (pageIndex, internationalizationContext): Awaitable<Omit<MessageSelectOptionData, "value">>

Parameters
NameType
pageIndexnumber
internationalizationContextPaginatedMessageInternationalizationContext
Returns

Awaitable<Omit<MessageSelectOptionData, "value">>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/PaginatedMessageTypes.ts:155


PaginatedMessageWrongUserInteractionReplyFunction

Ƭ PaginatedMessageWrongUserInteractionReplyFunction: (targetUser: User, interactionUser: User, internationalizationContext: PaginatedMessageInternationalizationContext) => Awaitable<Parameters<MessageComponentInteraction["reply"]>[0]>

Type declaration

▸ (targetUser, interactionUser, internationalizationContext): Awaitable<Parameters<MessageComponentInteraction["reply"]>[0]>

Parameters
NameType
targetUserUser
interactionUserUser
internationalizationContextPaginatedMessageInternationalizationContext
Returns

Awaitable<Parameters<MessageComponentInteraction["reply"]>[0]>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/PaginatedMessageTypes.ts:163


TextBasedChannelTypes

Ƭ TextBasedChannelTypes: Message["channel"]

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utility-types.ts:35


VoiceBasedChannelTypes

Ƭ VoiceBasedChannelTypes: VoiceChannel | StageChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utility-types.ts:40

Variables

ApplicationCommandLimits

Const ApplicationCommandLimits: Object

Type declaration

NameTypeDescription
MaximumDescriptionCharacters100
MaximumNameCharacters32
MaximumOptionsLength25

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:110


ApplicationCommandOptionLimits

Const ApplicationCommandOptionLimits: Object

Type declaration

NameTypeDescription
MaximumChoicesLength25
MaximumDescriptionCharacters100
MaximumNameCharacters32

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:127


AutoCompleteLimits

Const AutoCompleteLimits: Object

Type declaration

NameTypeDescription
MaximumAmountOfOptions25
MaximumLengthOfNameOfOption100

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:257


ButtonLimits

Const ButtonLimits: Object

Type declaration

NameTypeDescription
MaximumCustomIdCharacters100
MaximumLabelCharacters80

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:144


ChannelLimits

Const ChannelLimits: Object

Type declaration

NameTypeDescription
MaximumDescriptionLength1024
MaximumNameLength100
MaximumViewersPerScreenShare50

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:4


ChannelMentionRegex

Const ChannelMentionRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:6


ChannelMessageRegex

Const ChannelMessageRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:14


DiscordHostnameRegex

Const DiscordHostnameRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:23


DiscordInviteLinkRegex

Const DiscordInviteLinkRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:29


EmbedLimits

Const EmbedLimits: Object

Type declaration

NameTypeDescription
MaximumAuthorNameLength256
MaximumDescriptionLength4096
MaximumFieldNameLength256
MaximumFieldValueLength1024
MaximumFields25
MaximumFooterLength2048
MaximumTitleLength256
MaximumTotalCharacters6000

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:21


EmojiLimits

Const EmojiLimits: Object

Type declaration

NameTypeDescription
MaximumEmojiNameLength32

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:58


EmojiRegex

Const EmojiRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:37


FormattedCustomEmoji

Const FormattedCustomEmoji: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:43


FormattedCustomEmojiWithGroups

Const FormattedCustomEmojiWithGroups: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:52


GuildLimits

Const GuildLimits: Object

Type declaration

NameTypeDescription
MaximumChannels500
MaximumRoles250

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:67


GuildMemberLimits

Const GuildMemberLimits: Object

Type declaration

NameTypeDescription
MaximumDisplayNameLength32

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:80


HttpUrlRegex

Const HttpUrlRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:58


InteractionLimits

Const InteractionLimits: Object

Type declaration

NameTypeDescription
MaximumButtonsPerActionRow5
MaximumOptionsInSelectMenus25
MaximumSelectMenusPerActionRow1
MaximumTextInputsPerActionRow1

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:89


MessageLimits

Const MessageLimits: Object

Type declaration

NameTypeDescription
MaximumActionRows5
MaximumEmbeds10
MaximumLength2000
MaximumNitroLength4000
MaximumNitroUploadSize100000000
MaximumReactions20
MaximumUploadSize8000000
MaximumUploadSizeInGuildreadonly [8000000, 8000000, 50000000, 100000000]

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:186


MessageLinkRegex

Const MessageLinkRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:66


ModalLimits

Const ModalLimits: Object

Type declaration

NameTypeDescription
MaximumComponents5
MaximumCustomIdCharacters100
MaximumTitleCharacters45

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:270


ModerationLimits

Const ModerationLimits: Object

Type declaration

NameTypeDescription
MaximumTimeoutDuration2419200

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:226


ParsedCustomEmoji

Const ParsedCustomEmoji: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:73


ParsedCustomEmojiWithGroups

Const ParsedCustomEmojiWithGroups: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:83


RoleLimits

Const RoleLimits: Object

Type declaration

NameTypeDescription
MaximumNameLength100

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:235


RoleMentionRegex

Const RoleMentionRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:89


SelectMenuLimits

Const SelectMenuLimits: Object

Type declaration

NameTypeDescription
MaximumCustomIdCharacters100
MaximumLengthOfNameOfOption100
MaximumMaxValuesSize25
MaximumMinValuesSize25
MaximumOptionsLength25
MaximumPlaceholderCharacters150

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:157


SnowflakeRegex

Const SnowflakeRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:95


TextInputLimits

Const TextInputLimits: Object

Type declaration

NameTypeDescription
MaximumCustomIdCharacters100
MaximumLabelCharacters45
MaximumPlaceholderCharacters100
MaximumValueCharacters4000

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:287


TokenRegex

Const TokenRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:106


TwemojiRegex

Const TwemojiRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/TwemojiRegex.d.ts:5


UserLimits

Const UserLimits: Object

Type declaration

NameTypeDescription
MaximumBiographyLength190
MaximumUsersPerDMGroup10

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/limits.d.ts:244


UserOrMemberMentionRegex

Const UserOrMemberMentionRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:112


WebSocketUrlRegex

Const WebSocketUrlRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:118


WebhookRegex

Const WebhookRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/lib/regexes.d.ts:127

Functions

actionIsButtonOrMenu

actionIsButtonOrMenu(action): action is PaginatedMessageActionButton | PaginatedMessageActionMenu

Parameters

NameType
actionPaginatedMessageAction

Returns

action is PaginatedMessageActionButton | PaginatedMessageActionMenu

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/utils.ts:36


canJoinVoiceChannel

canJoinVoiceChannel(channel): boolean

Parameters

NameTypeDescription
channelNullish | VoiceBasedChannel

Returns

boolean

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utilities.ts:101


canReact

canReact(channel): boolean

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

boolean

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utilities.ts:72


canReadMessages

canReadMessages(channel): boolean

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

boolean

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utilities.ts:13


canRemoveAllReactions

canRemoveAllReactions(channel): boolean

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

boolean

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utilities.ts:87


canSendAttachments

canSendAttachments(channel): boolean

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

boolean

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utilities.ts:57


canSendEmbeds

canSendEmbeds(channel): boolean

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

boolean

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utilities.ts:42


canSendMessages

canSendMessages(channel): boolean

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

boolean

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/utilities.ts:27


createPartitionedMessageRow

createPartitionedMessageRow(components): MessageActionRow[]

Parameters

NameType
components(MessageButton | MessageSelectMenu)[]

Returns

MessageActionRow[]

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/utils.ts:55


isCategoryChannel

isCategoryChannel(channel): channel is CategoryChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is CategoryChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:25


isDMChannel

isDMChannel(channel): channel is DMChannel | PartialDMChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is DMChannel | PartialDMChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:33


isGroupChannel

isGroupChannel(channel): channel is PartialGroupDMChannel

Parameters

NameTypeDescription
channelPartialDMChannel | Channel | Nullish

Returns

channel is PartialGroupDMChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:41


isGuildBasedChannel

isGuildBasedChannel(channel): channel is GuildTextBasedChannelTypes

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is GuildTextBasedChannelTypes

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:50


isGuildBasedChannelByGuildKey

isGuildBasedChannelByGuildKey(channel): channel is GuildTextBasedChannelTypes

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is GuildTextBasedChannelTypes

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:60


isGuildMember

isGuildMember(member): member is GuildMember

Parameters

NameTypeDescription
memberGuildMember | Nullish | APIInteractionGuildMember | APIGuildMember | APIInteractionDataResolvedGuildMember

Returns

member is GuildMember

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:198


isMessageButtonComponent

isMessageButtonComponent(component): component is MessageButton

Parameters

NameType
componentMessageButton | MessageSelectMenu

Returns

component is MessageButton

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/utils.ts:51


isMessageButtonInteraction

isMessageButtonInteraction(interaction): interaction is InteractionButtonOptions

Parameters

NameType
interactionInteractionButtonOptions | MessageSelectMenuOptions

Returns

interaction is InteractionButtonOptions

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/utils.ts:45


isMessageInstance

isMessageInstance(message): message is Message<boolean>

Parameters

NameTypeDescription
messageMessage<boolean> | APIMessage

Returns

message is Message<boolean>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:189


isNewsChannel

isNewsChannel(channel): channel is NewsChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is NewsChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:68


isNewsThreadChannel

isNewsThreadChannel(channel): channel is ThreadChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is ThreadChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:117


isNsfwChannel

isNsfwChannel(channel): boolean

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

boolean

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:161


isPrivateThreadChannel

isPrivateThreadChannel(channel): channel is ThreadChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is ThreadChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:133


isPublicThreadChannel

isPublicThreadChannel(channel): channel is ThreadChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is ThreadChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:125


isStageChannel

isStageChannel(channel): channel is StageChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is StageChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:101


isStoreChannel

isStoreChannel(channel): channel is StoreChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is StoreChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:77


isTextBasedChannel

isTextBasedChannel(channel): channel is DMChannel | PartialDMChannel | NewsChannel | TextChannel | ThreadChannel | VoiceChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is DMChannel | PartialDMChannel | NewsChannel | TextChannel | ThreadChannel | VoiceChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:141


isTextChannel

isTextChannel(channel): channel is TextChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is TextChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:85


isThreadChannel

isThreadChannel(channel): channel is ThreadChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is ThreadChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:109


isVoiceBasedChannel

isVoiceBasedChannel(channel): channel is BaseGuildVoiceChannel

Parameters

NameType
channelChannel | Nullish

Returns

channel is BaseGuildVoiceChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:151


isVoiceChannel

isVoiceChannel(channel): channel is VoiceChannel

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

channel is VoiceChannel

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/type-guards.ts:93


runsOnInteraction

runsOnInteraction(messageOrInteraction): messageOrInteraction is CommandInteraction<CacheType> | ContextMenuInteraction<CacheType> | ButtonInteraction<CacheType> | SelectMenuInteraction<CacheType>

Parameters

NameTypeDescription
messageOrInteractionMessage<boolean> | APIMessage | CommandInteraction<CacheType> | ContextMenuInteraction<CacheType> | ButtonInteraction<CacheType> | SelectMenuInteraction<CacheType>

Returns

messageOrInteraction is CommandInteraction<CacheType> | ContextMenuInteraction<CacheType> | ButtonInteraction<CacheType> | SelectMenuInteraction<CacheType>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/utils.ts:30


safelyReplyToInteraction

safelyReplyToInteraction<T>(parameters): Promise<void>

Type parameters

NameType
Textends "edit" | "reply"

Parameters

NameTypeDescription
parametersSafeReplyToInteractionParameters<T>

Returns

Promise<void>

Defined in

projects/utilities/packages/discord.js-utilities/src/lib/PaginatedMessages/utils.ts:81