Skip to main content

Module: discord.js-utilities/src

Classes

Interfaces

Type Aliases

AnyInteraction

Ƭ AnyInteraction: NonModalInteraction | ModalSubmitInteraction

Defined in

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


ChannelTypeString

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

Defined in

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


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:24


ChatInputOrContextMenuInteraction

Ƭ ChatInputOrContextMenuInteraction: CommandInteraction | ContextMenuInteraction

Defined in

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


GuildBasedChannelTypes

Ƭ GuildBasedChannelTypes: NonThreadGuildBasedChannelTypes | ThreadChannel

Defined in

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


GuildTextBasedChannelTypes

Ƭ GuildTextBasedChannelTypes: NonThreadGuildTextBasedChannelTypes | ThreadChannel

Defined in

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


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


NonModalInteraction

Ƭ NonModalInteraction: ChatInputOrContextMenuInteraction | SelectMenuInteraction | ButtonInteraction

Defined in

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


NonThreadGuildBasedChannelTypes

Ƭ NonThreadGuildBasedChannelTypes: Extract<ChannelTypes, GuildChannel>

Defined in

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


NonThreadGuildTextBasedChannelTypes

Ƭ NonThreadGuildTextBasedChannelTypes: Extract<TextBasedChannelTypes, GuildChannel>

Defined in

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


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


PaginatedMessageStopReasons

Ƭ PaginatedMessageStopReasons: "time" | "idle" | "user" | "messageDelete" | "channelDelete" | "threadDelete" | "guildDelete" | "limit" | "componentLimit" | "userLimit"

Defined in

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


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:40


VoiceBasedChannelTypes

Ƭ VoiceBasedChannelTypes: VoiceChannel | StageChannel

Defined in

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

Variables

ApplicationCommandLimits

Const ApplicationCommandLimits: Object

Type declaration

NameTypeDescription
MaximumDescriptionCharacters100
MaximumNameCharacters32
MaximumOptionsLength25

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:195


ApplicationCommandOptionLimits

Const ApplicationCommandOptionLimits: Object

Type declaration

NameTypeDescription
MaximumChoicesLength25
MaximumDescriptionCharacters100
MaximumNameCharacters32

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:212


AutoCompleteLimits

Const AutoCompleteLimits: Object

Type declaration

NameTypeDescription
MaximumAmountOfOptions25
MaximumLengthOfNameOfOption100

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:342


ButtonLimits

Const ButtonLimits: Object

Type declaration

NameTypeDescription
MaximumCustomIdCharacters100
MaximumLabelCharacters80

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:229


ChannelLimits

Const ChannelLimits: Object

Type declaration

NameTypeDescription
MaximumDescriptionLength1024
MaximumNameLength100
MaximumViewersPerScreenShare50

Defined in

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


ChannelMentionRegex

Const ChannelMentionRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:396


ChannelMessageRegex

Const ChannelMessageRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:404


DiscordHostnameRegex

Const DiscordHostnameRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:413


DiscordInviteLinkRegex

Const DiscordInviteLinkRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:419


EmbedLimits

Const EmbedLimits: Object

Type declaration

NameTypeDescription
MaximumAuthorNameLength256
MaximumDescriptionLength4096
MaximumFieldNameLength256
MaximumFieldValueLength1024
MaximumFields25
MaximumFooterLength2048
MaximumTitleLength256
MaximumTotalCharacters6000

Defined in

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


EmojiLimits

Const EmojiLimits: Object

Type declaration

NameTypeDescription
MaximumEmojiNameLength32

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:143


EmojiRegex

Const EmojiRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:427


FormattedCustomEmoji

Const FormattedCustomEmoji: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:433


FormattedCustomEmojiWithGroups

Const FormattedCustomEmojiWithGroups: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:442


GuildLimits

Const GuildLimits: Object

Type declaration

NameTypeDescription
MaximumChannels500
MaximumRoles250

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:152


GuildMemberLimits

Const GuildMemberLimits: Object

Type declaration

NameTypeDescription
MaximumDisplayNameLength32

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:165


HttpUrlRegex

Const HttpUrlRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:448


InteractionLimits

Const InteractionLimits: Object

Type declaration

NameTypeDescription
MaximumButtonsPerActionRow5
MaximumOptionsInSelectMenus25
MaximumSelectMenusPerActionRow1
MaximumTextInputsPerActionRow1

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:174


MessageLimits

Const MessageLimits: Object

Type declaration

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

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:271


MessageLinkRegex

Const MessageLinkRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:456


ModalLimits

Const ModalLimits: Object

Type declaration

NameTypeDescription
MaximumComponents5
MaximumCustomIdCharacters100
MaximumTitleCharacters45

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:355


ModerationLimits

Const ModerationLimits: Object

Type declaration

NameTypeDescription
MaximumTimeoutDuration2419200

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:311


ParsedCustomEmoji

Const ParsedCustomEmoji: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:463


ParsedCustomEmojiWithGroups

Const ParsedCustomEmojiWithGroups: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:473


RoleLimits

Const RoleLimits: Object

Type declaration

NameTypeDescription
MaximumNameLength100

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:320


RoleMentionRegex

Const RoleMentionRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:479


SelectMenuLimits

Const SelectMenuLimits: Object

Type declaration

NameTypeDescription
MaximumCustomIdCharacters100
MaximumLengthOfNameOfOption100
MaximumMaxValuesSize25
MaximumMinValuesSize25
MaximumOptionsLength25
MaximumPlaceholderCharacters150

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:242


SnowflakeRegex

Const SnowflakeRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:485


TextInputLimits

Const TextInputLimits: Object

Type declaration

NameTypeDescription
MaximumCustomIdCharacters100
MaximumLabelCharacters45
MaximumPlaceholderCharacters100
MaximumValueCharacters4000

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:372


TokenRegex

Const TokenRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:496


TwemojiRegex

Const TwemojiRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:523


UserLimits

Const UserLimits: Object

Type declaration

NameTypeDescription
MaximumBiographyLength190
MaximumUsersPerDMGroup10

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:329


UserOrMemberMentionRegex

Const UserOrMemberMentionRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:502


WebSocketUrlRegex

Const WebSocketUrlRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:508


WebhookRegex

Const WebhookRegex: RegExp

Defined in

node_modules/@sapphire/discord-utilities/dist/index.d.ts:517

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:12


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:31


isAnyInteraction

isAnyInteraction(messageOrInteraction): messageOrInteraction is AnyInteraction

Parameters

NameTypeDescription
messageOrInteractionMessage<boolean> | BaseCommandInteraction<CacheType> | APIMessage | AnyInteraction

Returns

messageOrInteraction is AnyInteraction

Defined in

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


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:32


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:40


isGroupChannel

isGroupChannel(channel): channel is PartialGroupDMChannel

Parameters

NameTypeDescription
channelNullish | PartialDMChannel | Channel

Returns

channel is PartialGroupDMChannel

Defined in

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


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:57


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:67


isGuildMember

isGuildMember(member): member is GuildMember

Parameters

NameTypeDescription
memberNullish | GuildMember | APIInteractionGuildMember | APIGuildMember | APIInteractionDataResolvedGuildMember

Returns

member is GuildMember

Defined in

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


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:27


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:21


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:196


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:75


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:124


isNsfwChannel

isNsfwChannel(channel): boolean

Parameters

NameTypeDescription
channelNullish | ChannelTypes

Returns

boolean

Defined in

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


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:140


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:132


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:108


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:84


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:148


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:92


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:116


isVoiceBasedChannel

isVoiceBasedChannel(channel): channel is BaseGuildVoiceChannel

Parameters

NameType
channelNullish | Channel

Returns

channel is BaseGuildVoiceChannel

Defined in

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


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:100


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:57