Module: @sapphire/discord-utilities
Classes
Variables
ActionMetadataLimits
• Const
ActionMetadataLimits: Object
Namespace containing limits related to Discord Auto Moderation Action Metadata.
Type declaration
Name | Type | Description |
---|---|---|
MaximumCustomBlockMessageLength | 150 | Maximum number of characters allowed in a custom block message. |
MaximumTimeoutDurationSeconds | 2419200 | Maximum timeout duration in seconds. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:670
AllowedMentionsLimits
• Const
AllowedMentionsLimits: Object
Namespace containing limits related to Discord Message Allowed Mentions.
Type declaration
Name | Type | Description |
---|---|---|
MaximumRoles | 100 | Maximum number of roles allowed in an allowed mentions object. |
MaximumUsers | 100 | Maximum number of users allowed in an allowed mentions object. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:685
ApplicationCommandLimits
• Const
ApplicationCommandLimits: Object
Namespace containing limits related to Discord application commands (slash commands).
Type declaration
Name | Type | Description |
---|---|---|
MaximumCombinedCharacters | 4000 | Maximum combined characters allowed in the name, description, and value properties of an application command, its options (including subcommands and groups), and choices. |
MaximumDescriptionCharacters | 100 | Maximum characters allowed in an application command description. |
MaximumNameCharacters | 32 | Maximum characters allowed in an application command name. |
MaximumOptionsLength | 25 | Maximum options allowed in an application command. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:236
ApplicationCommandOptionLimits
• Const
ApplicationCommandOptionLimits: Object
Namespace containing limits related to Choices of Discord Application Commands.
Type declaration
Name | Type | Description |
---|---|---|
MaximumChoicesLength | 25 | Maximum length of choices allowed in the option of an application command. |
MaximumDescriptionCharacters | 100 | Maximum characters allowed in the description of an option of an application command. |
MaximumNameCharacters | 32 | Maximum characters allowed in the name of an option of an application command. |
MaximumStringLength | 6000 | Maximum length of string allowed in the string option of an application command. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:261
ApplicationCommandPermissionLimits
• Const
ApplicationCommandPermissionLimits: Object
Namespace containing limits related to Permissions of Discord Application Commands.
Type declaration
Name | Type | Description |
---|---|---|
MaximumPermissionsLength | 100 | Maximum length of permissions allowed in the option of an application command. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:286
ApplicationRoleConnectionLimits
• Const
ApplicationRoleConnectionLimits: Object
Namespace containing limits related to Discord Application Role Connections.
Type declaration
Name | Type | Description |
---|---|---|
MaximumMetadataRecords | 5 | Maximum application role connection metadata records an application can have. |
MaximumMetadataValueLength | 100 | Maximum characters allowed in metadata values. |
MaximumPlatformNameLength | 50 | Maximum characters allowed in a platform name. |
MaximumPlatformUsernameLength | 100 | Maximum characters allowed in a platform username. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:540
AutoCompleteLimits
• Const
AutoCompleteLimits: Object
Namespace container limits related to Discord autocomplete interactions.
Type declaration
Name | Type | Description |
---|---|---|
MaximumAmountOfOptions | 25 | Maximum options allowed in a single autocomplete response. |
MaximumLengthOfNameOfOption | 100 | Maximum characters allowed in a select menu option's name. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:480
AutoModerationRuleLimits
• Const
AutoModerationRuleLimits: Object
Namespace containing limits related to Discord Auto Moderation Rules.
Type declaration
Name | Type | Description |
---|---|---|
MaximumExemptChannels | 50 | Maximum number of exempt channels a rule can have. |
MaximumExemptRoles | 20 | Maximum number of exempt roles a rule can have. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:580
ButtonLimits
• Const
ButtonLimits: Object
Namespace containing limits related to Message Buttons.
Type declaration
Name | Type | Description |
---|---|---|
MaximumCustomIdCharacters | 100 | Maximum characters allowed in a button custom ID. |
MaximumLabelCharacters | 80 | Maximum characters allowed in a button label. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:296
ChannelInviteLimits
• Const
ChannelInviteLimits: Object
Namespace containing limits related to Discord Channel Invites.
Type declaration
Name | Type | Description |
---|---|---|
MaximumAgeSeconds | 604800 | Maximum age of an invite in seconds. |
MaximumUses | 100 | Maximum number of uses allowed for an invite. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:700
ChannelLimits
• Const
ChannelLimits: Object
Namespace containing limits related to Discord channels.
Type declaration
Name | Type | Description |
---|---|---|
MaximumDescriptionLength | 1024 | Maximum characters allowed in a channel description. |
MaximumNameLength | 100 | Maximum characters allowed in a channel name. |
MaximumViewersPerScreenShare | 50 | Maximum viewers allowed per screen share. Deprecated Use VoiceChannelLimits.MaximumViewersPerScreenShare instead. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:4
ChannelMentionRegex
• Const
ChannelMentionRegex: RegExp
Regex that can capture the ID in Discord Channel mentions
Raw
/^<#(?<id>\d{17,20})>$/
Remark
Capture group 1 is the ID of the channel. It is named id
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:6
ChannelMessageRegex
• Const
ChannelMessageRegex: RegExp
Regex that can capture the channel and message IDs in a channelId-messageId pattern This pattern can be found when you hold Shift and hover over a message, and click the "ID" button
Raw
/^(?<channelId>\d{17,20})-(?<messageId>\d{17,20})$/
Remark
Capture group 1 is the ID of the channel, named channelId
.
Remark
Capture group 2 is the ID of the message, named messageId
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:15
DiscordHostnameRegex
• Const
DiscordHostnameRegex: RegExp
Regex that matches links on the known Discord host names
Raw
/(?<subdomain>\w+)\.?(?<hostname>dis(?:cord)?(?:app|merch|status)?)\.(?<tld>com|g(?:d|g|ift)|(?:de(?:sign|v))|media|new|store|net)/i
Remark
The regex is case insensitive
Remark
Capture group 1 is the subdomain for this URL. It is named subdomain
.
Remark
Capture group 2 is the hostname for this URL, primarily discord
but can also be discordmerch
, discordstatus
, dis
, and discordapp
. It is named hostname
.
Remark
Capture group 3 is the Top-Level Domain without .
. It is named tld
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:25
DiscordInviteLinkRegex
• Const
DiscordInviteLinkRegex: RegExp
Regex that can can capture the code of Discord invite links
Raw
/(?:^|\b)discord(?:(?:app)?\.com/invite|\.gg(?:/invite)?)/(?<code>[\w-]{2,255})(?:$|\b)/gi
Remark
Capture group 1 is the invite URL's unique code. It is named code
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:33
EmbedLimits
• Const
EmbedLimits: Object
Namespace containing limits related to Discord embeds.
Type declaration
Name | Type | Description |
---|---|---|
MaximumAuthorNameLength | 256 | Maximum characters allowed in the author field of an embed. |
MaximumDescriptionLength | 4096 | Maximum characters allowed in an embed description. |
MaximumFieldNameLength | 256 | Maximum characters allowed in the name of a field in an embed. |
MaximumFieldValueLength | 1024 | Maximum characters allowed in the value of a field in an embed. |
MaximumFields | 25 | Maximum fields allowed in an embed. |
MaximumFooterLength | 2048 | Maximum characters allowed in a footer of an embed. |
MaximumTitleLength | 256 | Maximum characters allowed in the title of an embed. |
MaximumTotalCharacters | 6000 | Maximum characters allowed in an embed, in total. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:75
EmojiLimits
• Const
EmojiLimits: Object
Namespace containing limits related to Discord emojis.
Type declaration
Name | Type | Description |
---|---|---|
MaximumEmojiNameLength | 32 | Maximum characters allowed in a custom guild emoji. |
MaximumEmojiSize | 256000 | Maximum size allowed for a custom guild emoji. Size is in bytes, and corresponds to 256KB. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:120
EmojiRegex
• Const
EmojiRegex: RegExp
Regex that can capture the ID of any animated or non-animated custom Discord emoji
Raw
/^(?:<(?<animated>a)?:(?<name>\w{2,32}):)?(?<id>\d{17,21})>?$/
Remark
Capture group 1 can be used to determine whether the emoji is animated or not. It is named animated
.
Remark
Capture group 2 is the name of the emoji as it is typed in a message. It is named name
.
Remark
Capture group 3 is the ID of the emoji. It is named id
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:42
FormattedCustomEmoji
• Const
FormattedCustomEmoji: RegExp
Regex that matches any animated or non-animated custom Discord emoji. Unlike EmojiRegex It can be a substring of a larger string.
Raw
/<a?:\w{2,32}:\d{17,20}>/
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:49
FormattedCustomEmojiWithGroups
• Const
FormattedCustomEmojiWithGroups: RegExp
Regex that can capture any animated or non-animated custom Discord emoji. Similar to FormattedCustomEmoji and unlike EmojiRegex can also be a substring of a larger string.
Raw
/(?<animated>a?):(?<name>[^:]+):(?<id>\d{17,20})/
Remark
Capture group 1 can be used to determine whether the emoji is animated or not. It is named animated
.
Remark
Capture group 2 is the name of the emoji as it is typed in a message. It is named name
.
Remark
Capture group 3 is the ID of the emoji. It is named id
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:59
GuildAuditLogsLimits
• Const
GuildAuditLogsLimits: Object
Namespace containing limits related to Discord Guild Audit Logs.
Type declaration
Name | Type | Description |
---|---|---|
MaximumEntriesToFetch | 100 | Maximum number of entries to return from the guild audit log API. |
MinimumEntriesToFetch | 1 | Minimum number of entries to return from the guild audit log API. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:565
GuildBansLimits
• Const
GuildBansLimits: Object
Namespace containing limits related to Discord guild bans.
Type declaration
Name | Type | Description |
---|---|---|
MaximumBansToFetch | 1000 | Maximum number of bans to return from the guild bans API. |
MinimumBansToFetch | 1 | Minimum number of bans to return from the guild bans API. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:196
GuildIntegrationLimits
• Const
GuildIntegrationLimits: Object
Namespace containing limits related to Discord Guild Integrations.
Type declaration
Name | Type | Description |
---|---|---|
MaximumIntegrationsToFetch | 50 | Maximum number of integrations returned from the guild integrations API. Needs a more description name than "MaximumIntegrations". |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:715
GuildLimits
• Const
GuildLimits: Object
Namespace containing limits related to Discord guilds.
Type declaration
Name | Type | Description |
---|---|---|
MaximumChannels | 500 | Maximum channels allowed per guild, including category channels. |
MaximumRoles | 250 | Maximum roles allowed in a guild. |
MaximumScheduledOrActiveEvents | 100 | Maximum scheduled or active events allowed in a guild. |
MaximumUserGuildsToFetch | 200 | Maximum number of user guilds to return from the user guilds API. |
MinimumUserGuildsToFetch | 1 | Minimum number of user guilds to return from the user guilds API. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:136
GuildMemberLimits
• Const
GuildMemberLimits: Object
Namespace containing limits related to Discord guild members.
Type declaration
Name | Type | Description |
---|---|---|
MaximumDisplayNameLength | 32 | Maximum characters allowed in the display name of a guild member. |
MaximumMembersToFetch | 1000 | Maximum number of members to return from the guild members API. |
MinimumMembersToFetch | 1 | Minimum number of members to return from the guild members API. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:176
GuildScheduledEventLimits
• Const
GuildScheduledEventLimits: Object
Namespace containing limits related to Discord guild scheduled events.
Type declaration
Name | Type | Description |
---|---|---|
MaximumUsersToFetch | 100 | Maximum number of users to return from the guild scheduled event users API. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:166
HttpUrlRegex
• Const
HttpUrlRegex: RegExp
Regex that matches any URL starting with http
or https
Raw
/^https?:///
Remark
for WebSocket URLs see WebsocketGenericUrlRegex
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:66
InteractionLimits
• Const
InteractionLimits: Object
Namespace containing limits related to Discord interactions.
Type declaration
Name | Type | Description |
---|---|---|
MaximumButtonsPerActionRow | 5 | Maximum buttons allowed in a single action row. |
MaximumOptionsInSelectMenus | 25 | Maximum options allowed in a single select menu. |
MaximumSelectMenusPerActionRow | 1 | Maximum select menus allowed in a single action row. |
MaximumTextInputsPerActionRow | 1 | Maximum text inputs allowed in a single action row. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:211
MessageLimits
• Const
MessageLimits: Object
Namespace containing limits related to Discord messages.
Type declaration
Name | Type | Description |
---|---|---|
MaximumActionRows | 5 | Maximum action rows allowed in a single message. |
MaximumEmbeds | 10 | Maximum embeds allowed in a single message. |
MaximumLength | 2000 | Maximum characters allowed in a single message for a user. |
MaximumMessagesToBulkDelete | 100 | Maximum number of messages to delete in a single bulk delete request. |
MaximumMessagesToFetch | 100 | Maximum number of messages to return from the channel messages API. |
MaximumNitroLength | 4000 | Maximum characters allowed in a single message for a nitro user. |
MaximumNitroUploadSize | 5000000000 | Maximum upload size for a nitro user, in any guild or in DMs. Size is in bytes, and corresponds to 500MB. |
MaximumReactions | 20 | Maximum numbers of reactions allowed for a message. |
MaximumRequestSize | 25000000 | Maximum request size when sending a messages. Size is in bytes, and corresponds to 25MB. |
MaximumUploadSize | 8000000 | Maximum upload size for a free user in a guild of tier 1 or below, or in DMs. Size is in bytes, and corresponds to 8MB. |
MaximumUploadSizeInGuild | readonly [8000000 , 8000000 , 50000000 , 100000000 ] | Maximum upload size for a free user for all different boost levels available in a guild. Sizes are in bytes, and correspond to 8MB, 8MB, 50MB, and 100MB. |
MinimumMessagesToBulkDelete | 2 | Minimum number of messages to delete in a single bulk delete request. |
MinimumMessagesToFetch | 1 | Minimum number of messages to return from the channel messages API. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:356
MessageLinkRegex
• Const
MessageLinkRegex: RegExp
Regex that can capture the Guild, Channel, and Message ID based on a shareable Discord message link.
Raw
/^(?:https://)?(?:ptb\.|canary\.)?discord(?:app)?\.com/channels/(?<guildId>(?:\d{17,20}|@me))/(?<channelId>\d{17,20})/(?<messageId>\d{17,20})$/
Remark
Capture group 1 is the ID of the guild the message was sent in. It is named guildId
.
Remark
Capture group 2 is the ID of the channel in that guild the message was sent in. It is named channelId
.
Remark
Capture group 3 is the ID of the message itself. It is named messageId
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:75
ModalLimits
• Const
ModalLimits: Object
Namespace containing limits related to Discord Modals.
Type declaration
Name | Type | Description |
---|---|---|
MaximumComponents | 5 | Maximum components allowed in a modal. |
MaximumCustomIdCharacters | 100 | Maximum characters allowed in a modal custom ID. |
MaximumTitleCharacters | 45 | Maximum characters allowed in a modal title. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:495
ModerationLimits
• Const
ModerationLimits: Object
Namespace containing limits related to built-in moderation features.
Type declaration
Name | Type | Description |
---|---|---|
MaximumTimeoutDuration | 2419200 | Maximum duration of a guild timeout, in seconds (corresponds to 28 days). |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:445
ParsedCustomEmoji
• Const
ParsedCustomEmoji: RegExp
Regex that matches any animated or non-animated custom Discord emoji *without the wrapping <...>
symbols.
This means that a string that matches this regex can directly be send inside a Discord message.
Other than this difference it is similar to FormattedCustomEmoji.
Raw
/a?:\w{2,32}:\d{17,20}/
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:84
ParsedCustomEmojiWithGroups
• Const
ParsedCustomEmojiWithGroups: RegExp
Regex that matches any animated or non-animated custom Discord emoji *without the wrapping <...>
symbols.
This means that a string that matches this regex can directly be send inside a Discord message.
Other than this difference it is similar to FormattedCustomEmojiWithGroups.
Raw
/(?<animated>a?):(?<name>[^:]+):(?<id>\d{17,20})/
Remark
Capture group 1 can be used to determine whether the emoji is animated or not. It is named animated
.
Remark
Capture group 2 is the name of the emoji as it is typed in a message. It is named name
.
Remark
Capture group 3 is the ID of the emoji. It is named id
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:95
ReactionLimits
• Const
ReactionLimits: Object
Namespace containing limits related to Discord message reactions.
Type declaration
Name | Type | Description |
---|---|---|
MaximumReactionsToFetch | number | Maximum number of reactions to fetch from the message reactions API. |
MinimumReactionToFetch | number | Minimum number of reactions to fetch from the message reactions API. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:430
RoleLimits
• Const
RoleLimits: Object
Namespace containing limits related to Discord roles.
Type declaration
Name | Type | Description |
---|---|---|
MaximumNameLength | 100 | Maximum characters allowed in a role name. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:455
RoleMentionRegex
• Const
RoleMentionRegex: RegExp
Regex that can capture the ID in Discord Role mentions
Raw
/^<@&(?<id>\d{17,20})>$/
Remark
Capture group 1 is the ID of the role. It is named id
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:102
SelectMenuLimits
• Const
SelectMenuLimits: Object
Namespace containing limits related to Select Menus.
Type declaration
Name | Type | Description |
---|---|---|
MaximumCustomIdCharacters | 100 | Maximum characters allowed in a select menu custom ID. |
MaximumLengthOfDescriptionOfOption | 100 | Maximum characters allowed in a select menu option's description. |
MaximumLengthOfNameOfOption | 100 | Maximum characters allowed in a select menu option's name. |
MaximumLengthOfValueOfOption | 100 | Maximum characters allowed in a select menu option's value. |
MaximumMaxValuesSize | 25 | Maximum "maximum" values allowed in a select menu. |
MaximumMinValuesSize | 25 | Maximum "minimum" values allowed in a select menu. |
MaximumOptionsLength | 25 | Maximum amount of options allowed in a select menu. |
MaximumPlaceholderCharacters | 150 | Maximum characters allowed in a select menu placeholder. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:311
SnowflakeRegex
• Const
SnowflakeRegex: RegExp
Regex that can capture any Discord Snowflake ID
Raw
/^(?<id>\d{17,20})$/
Remark
Capture group 1 is the Snowflake. It is named id
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:109
StageChannelLimits
• Const
StageChannelLimits: Object
Namespace containing limits related to Discord stage channels.
Type declaration
Name | Type | Description |
---|---|---|
MaximumUserLimit | number | Maximum user limit of stage channel. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:40
StickerLimits
• Const
StickerLimits: Object
Namespace containing limits related to Discord Stickers.
Type declaration
Name | Type | Description |
---|---|---|
MaximumStickerSize | number | Maximum size allowed for a sticker. Size is in bytes, and corresponds to 512KB. |
MaximumTagsLength | number | Maximum number of characters allowed in the autocomplete/suggestion tags for the sticker. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:725
TextChannelLimits
• Const
TextChannelLimits: Object
Namespace containing limits related to Discord text channels.
Type declaration
Name | Type | Description |
---|---|---|
MaximumMessagePins | 50 | Maximum pins allowed in a text channel. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:50
TextInputLimits
• Const
TextInputLimits: Object
Namespace containing limits related to Discord Modal Text Input component.
Type declaration
Name | Type | Description |
---|---|---|
MaximumCustomIdCharacters | 100 | Maximum characters allowed in a text input custom ID. |
MaximumLabelCharacters | 45 | Maximum characters allowed in a text input label. |
MaximumPlaceholderCharacters | 100 | Maximum characters allowed in a text input placeholder. |
MaximumValueCharacters | 4000 | Maximum characters allowed in a text input value. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:515
ThreadLimits
• Const
ThreadLimits: Object
Namespace containing limits related to Discord threads.
Type declaration
Name | Type | Description |
---|---|---|
MaximumThreadsToFetch | 100 | Maximum number of threads to return from the threads API. |
MinimumThreadsToFetch | 1 | Minimum number of threads to return from the threads API. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:60
TokenRegex
• Const
TokenRegex: RegExp
Regex that can capture a Discord Token
Raw
/(?<mfaToken>mfa\.[a-z0-9_-]{20,})|(?<basicToken>[a-z0-9_-]{23,28}\.[a-z0-9_-]{6,7}\.[a-z0-9_-]{27})/i
Remark
Capture group 1 can be used to retrieve a token for a User that has Multi-Factor Authentication enabled. It is named mfaToken
.
Remark
Capture group 2 can be used to retrieve a token for a User that doesn't have Multi-Factor Authentication enabled, or a Bot application. It is named basicToken
.
Remark
For a valid token, either Capture group 1 or Capture group 2 will always be undefined, whereas the other group will then be defined and contain the matched token. You can use the name of the capture group to determine if the validated token was configured for a user with Multi-Factor Authentication, for a user without Multi-Factor Authentication, or for a bot application. If both capture groups are undefined, then the token is invalid.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:121
TriggerMetadataLimits
• Const
TriggerMetadataLimits: Object
Namespace containing limits related to Discord Auto Moderation Trigger Metadata.
Type declaration
Name | Type | Description |
---|---|---|
MaximumCharactersPerRegexPattern | 260 | Maximum number of characters allowed in a regular expression pattern. |
MaximumKeywordAllowListKeywordLength | 60 | Maximum characters per keyword that should not trigger the keyword rule. |
MaximumKeywordAllowListLength | 100 | Maximum number of substrings which should not trigger the keyword rule. |
MaximumKeywordFilterLength | 60 | Maximum number of characters allowed in a keyword filter. |
MaximumKeywordFilters | 1000 | Maximum number of substrings which will be searched for in content. |
MaximumKeywordPresetAllowListKeywordPresetLength | 60 | Maximum characters per keyword should not trigger the keyword preset rule. |
MaximumKeywordPresetAllowListLength | 1000 | Maximum number of substrings which should not trigger the keyword preset rule. |
MaximumMentionSpamTotalMentions | 50 | Maximum number of unique role and user mentions allowed per message. |
MaximumRegexPatterns | 10 | Maximum number of regular expression patterns which will be matched against content. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:620
TriggerTypeLimits
• Const
TriggerTypeLimits: Object
Namespace containing limits related to Discord Auto Moderation Triggers.
Type declaration
Name | Type | Description |
---|---|---|
MaximumKeywordPresetTriggersPerChannel | 1 | Maximum number of keyword triggers a channel can have. |
MaximumKeywordTriggersPerGuild | 6 | Maximum number of keyword triggers a guild can have. |
MaximumMentionSpamTriggersPerChannel | 1 | Maximum number of mention spam triggers a channel can have. |
MaximumSpamTriggersPerGuild | 1 | Maximum number of mention spam triggers a guild can have. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:595
TwemojiRegex
• Const
TwemojiRegex: RegExp
Regex that can capture a Twemoji (Twitter Emoji)
Raw
Defined in
projects/utilities/packages/discord-utilities/src/lib/TwemojiRegex.ts:5
UserLimits
• Const
UserLimits: Object
Namespace containing limits related to Discord users and Direct Messages.
Type declaration
Name | Type | Description |
---|---|---|
MaximumBiographyLength | 190 | Maximum characters allowed in a user's biography (the "About Me" section). |
MaximumUsersPerDMGroup | 10 | Maximum numbers of users in a DM group. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:465
UserOrMemberMentionRegex
• Const
UserOrMemberMentionRegex: RegExp
Regex that can capture the ID of a user in Discord user mentions
Raw
/^<@!?(?<id>\d{17,20})>$/
Remark
Capture group 1 is the ID of the user. It is named id
.
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:128
VoiceChannelLimits
• Const
VoiceChannelLimits: Object
Namespace containing limits related to Discord voice channels.
Type declaration
Name | Type | Description |
---|---|---|
MaximumUserLimit | number | Maximum user limit of voice channel. |
MaximumViewersPerScreenShare | number | Maximum viewers allowed per screen share. |
Defined in
projects/utilities/packages/discord-utilities/src/lib/limits.ts:25
WebSocketUrlRegex
• Const
WebSocketUrlRegex: RegExp
Regex that matches any WebSocket URL starting with ws
or wss
Raw
/^wss?:///
Remark
for regular HTTP URLs see HttpUrlRegex
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:135
WebhookRegex
• Const
WebhookRegex: RegExp
Regex that captures the Webhook ID and token from a Discord Webhook URL.
Raw
/(?<url>^https://(?:(?:canary|ptb).)?discord(?:app)?.com/api(?:/v\d+)?/webhooks/(?<id>\d+)/(?<token>[\w-]+)/?$)/
Remark
Capture group 1 is the full URL of the Discord Webhook. It is named url
.
Remark
Capture group 2 is the ID of the Discord Webhook. It is named id
.
Remark
Capture group 3 is the token of the Discord Webhook. It is named token
.
Remark
for regular HTTP URLs see HttpUrlRegex
Defined in
projects/utilities/packages/discord-utilities/src/lib/regexes.ts:145