Expand description
Contains all other input validation functions.
These functions are generally not related to a specific Discord model.
Structs§
- Validation
Error - A field is not valid.
Enums§
- Validation
Error Type - Type of
ValidationError
that occurred.
Constants§
- AUDIT_
REASON_ MAX - The maximum audit log reason length in UTF-16 codepoints.
- AUTO_
MODERATION_ ACTION_ BLOCK_ CUSTOM_ MESSAGE_ LENGTH_ MAX - Maximum length of an auto moderation block action’s custom message.
- AUTO_
MODERATION_ ACTION_ METADATA_ DURATION_ SECONDS_ MAX - Maximum amount of seconds (
2_419_200
this is equivalent to28
days) to disable communication for. - AUTO_
MODERATION_ EXEMPT_ CHANNELS_ MAX - Maximum amount of exempt channels for the auto moderation rule.
- AUTO_
MODERATION_ EXEMPT_ ROLES_ MAX - Maximum amount of exempt roles for the auto moderation rule.
- AUTO_
MODERATION_ METADATA_ KEYWORD_ ALLOW_ LIST_ LENGTH_ MAX - Maximum length of a allowed keyword.
- AUTO_
MODERATION_ METADATA_ KEYWORD_ ALLOW_ LIST_ MAX - Maximum amount of allowed keywords when using the custom keywords.
- AUTO_
MODERATION_ METADATA_ KEYWORD_ FILTER_ LENGTH_ MAX - Maximum length of a keyword in the keyword filter.
- AUTO_
MODERATION_ METADATA_ KEYWORD_ FILTER_ MAX - Maximum amount of keywords allowed in the keyword filter.
- AUTO_
MODERATION_ METADATA_ MENTION_ TOTAL_ LIMIT - Maximum amount of mentions that triggers an auto moderation action.
- AUTO_
MODERATION_ METADATA_ PRESET_ ALLOW_ LIST_ LENGTH_ MAX - Maximum length of a keyword preset keyword.
- AUTO_
MODERATION_ METADATA_ PRESET_ ALLOW_ LIST_ MAX - Maximum amount of allowed keywords when using a keyword preset.
- AUTO_
MODERATION_ METADATA_ REGEX_ PATTERNS_ LENGTH_ MAX - Maximum length of a regex pattern.
- AUTO_
MODERATION_ METADATA_ REGEX_ PATTERNS_ MAX - Maximum amount of regex patterns that trigger the auto moderation.
- COMMUNICATION_
DISABLED_ MAX_ DURATION - Maximum amount of time a member can be timed out for.
- CREATE_
GUILD_ BAN_ DELETE_ MESSAGE_ SECONDS_ MAX - Maximum amount of seconds (
604_800
this is equivalent to7
days) for messages to be deleted upon ban. - GET_
CHANNEL_ MESSAGES_ LIMIT_ MAX - Maximum amount of messages to get.
- GET_
CHANNEL_ MESSAGES_ LIMIT_ MIN - Minimum amount of messages to get.
- GET_
CURRENT_ USER_ GUILDS_ LIMIT_ MAX - Maximum amount of guilds to get.
- GET_
CURRENT_ USER_ GUILDS_ LIMIT_ MIN - Minimum amount of guilds to get.
- GET_
ENTITLEMENTS_ LIMIT_ MAX - Maximum amount of entitlements to get.
- GET_
ENTITLEMENTS_ LIMIT_ MIN - Minimum amount of entitlements to get.
- GET_
GUILD_ AUDIT_ LOG_ LIMIT_ MAX - Maximum amount of audit log entries to list.
- GET_
GUILD_ AUDIT_ LOG_ LIMIT_ MIN - Minimum amount of audit log entries to list.
- GET_
GUILD_ BANS_ LIMIT_ MAX - Maximum amount of guild bans to list.
- GET_
GUILD_ MEMBERS_ LIMIT_ MAX - Maximum amount of guild members to list.
- GET_
GUILD_ MEMBERS_ LIMIT_ MIN - Minimum amount of guild members to list.
- GET_
REACTIONS_ LIMIT_ MAX - Minimum amount of users to return when getting reactions.
- GET_
REACTIONS_ LIMIT_ MIN - Maximum amount of users to return when getting reactions.
- GUILD_
NAME_ LENGTH_ MAX - Maximum length of a guild’s name.
- GUILD_
NAME_ LENGTH_ MIN - Minimum length of a guild’s name.
- GUILD_
PRUNE_ DAYS_ MAX - Maximum amount of days to prune users from a guild.
- GUILD_
PRUNE_ DAYS_ MIN - Minimum amount of days to prune users from a guild.
- INVITE_
AGE_ MAX - Maximum length of an invite’s age, in seconds.
- INVITE_
USES_ MAX - Maximum uses of an invite, if not unlimited.
- NICKNAME_
LIMIT_ MAX - Maximum length of a maximum.
- NICKNAME_
LIMIT_ MIN - Minimum length of a nickname.
- SCHEDULED_
EVENT_ DESCRIPTION_ MAX - Maximum length of a scheduled event’s description.
- SCHEDULED_
EVENT_ DESCRIPTION_ MIN - Minimum length of a scheduled event’s description.
- SCHEDULED_
EVENT_ GET_ USERS_ MAX - Maximum amount of scheduled event users to get.
- SCHEDULED_
EVENT_ GET_ USERS_ MIN - Minimum amount of scheduled event users to get.
- SCHEDULED_
EVENT_ NAME_ MAX - Maximum length of a scheduled event’s name.
- SCHEDULED_
EVENT_ NAME_ MIN - Minimum length of a scheduled event’s name.
- SEARCH_
GUILD_ MEMBERS_ LIMIT_ MAX - Maximum amount of guild members to search for.
- SEARCH_
GUILD_ MEMBERS_ LIMIT_ MIN - Minimum amount of guild members to search for.
- STAGE_
TOPIC_ LENGTH_ MAX - Maximum stage instance topic length.
- STAGE_
TOPIC_ LENGTH_ MIN - Minimum stage instance topic length.
- TEMPLATE_
DESCRIPTION_ LENGTH_ MAX - Maximum length of a guild template description.
- TEMPLATE_
NAME_ LENGTH_ MAX - Maximum length of a guild template name.
- TEMPLATE_
NAME_ LENGTH_ MIN - Minimum length of a guild template name.
- USERNAME_
LIMIT_ MAX - Maximum length of a username.
- USERNAME_
LIMIT_ MIN - Minimum length of a username.
- WEBHOOK_
USERNAME_ LIMIT_ MAX - Maximum length of a webhook username.
- WEBHOOK_
USERNAME_ LIMIT_ MIN - Minimum length of a webhook username.
Functions§
- audit_
reason - Ensure that an audit reason is correct.
- auto_
moderation_ action_ metadata_ duration_ seconds - Ensure that the
duration_seconds
field for an auto moderation action metadata is correct. - auto_
moderation_ block_ action_ custom_ message_ limit - Ensure that an auto moderation block action’s
custom_message
is correct. - auto_
moderation_ exempt_ channels - Ensure that the
exempt_channels
field for an auto moderation rule is correct. - auto_
moderation_ exempt_ roles - Ensure that the
exempt_roles
field for an auto moderation rule is correct. - auto_
moderation_ metadata_ keyword_ allow_ list - Ensure that an auto moderation rule’s
allow_list
is correct. - auto_
moderation_ metadata_ keyword_ allow_ list_ item - Ensure that an auto moderation rule’s
allow_list
item is correct. - auto_
moderation_ metadata_ keyword_ filter - Ensure that an auto moderation rule’s
keyword_filter
is correct. - auto_
moderation_ metadata_ keyword_ filter_ item - Ensure that an auto moderation rule’s
keyword_filter
item is correct. - auto_
moderation_ metadata_ mention_ total_ limit - Ensure that an auto moderation rule’s
mention_total_limit
is correct. - auto_
moderation_ metadata_ preset_ allow_ list - Ensure that an auto moderation rule’s
allow_list
is correct when using presets. - auto_
moderation_ metadata_ preset_ allow_ list_ item - Ensure that an auto moderation rule’s
allow_list
item is correct when using presets. - auto_
moderation_ metadata_ regex_ patterns - Ensure that an auto moderation rule’s
regex_patterns
is correct. - auto_
moderation_ metadata_ regex_ patterns_ item - Ensure that an auto moderation rule’s
regex_patterns
item is correct. - communication_
disabled_ until - Validate that a timeout time is not too far in the future.
- create_
guild_ ban_ delete_ message_ seconds - Ensure that the delete message seconds amount for the Create Guild Ban request is correct.
- get_
channel_ messages_ limit - Ensure that the limit for the Get Channel Messages request is correct.
- get_
current_ user_ guilds_ limit - Ensure that the limit for the Get Current User Guilds request is correct.
- get_
entitlements_ limit - Ensure that the limit for the Get Entitlements endpoint is correct.
- get_
guild_ audit_ log_ limit - Ensure that the limit for the Get Guild Audit Log endpoint is correct.
- get_
guild_ bans_ limit - Ensure that the limit for the Get Guild Bans endpoint is correct.
- get_
guild_ members_ limit - Ensure that the limit for the Get Guild Members endpoint is correct.
- get_
reactions_ limit - Ensure that the limit for the Get Reactions endpoint is correct.
- guild_
name - Ensure that a guild name’s length is correct.
- guild_
prune_ days - Ensure that the days to prune members from a guild is correct.
- invite_
max_ age - Ensure that the invite max age is correct.
- invite_
max_ uses - Ensure that the invite max uses is correct.
- nickname
- Ensure that the nickname length is correct.
- scheduled_
event_ description - Ensure that a scheduled event’s description is correct.
- scheduled_
event_ get_ users - Ensure that a scheduled event’s get users limit amount is correct.
- scheduled_
event_ name - Ensure that a scheduled event’s name is correct.
- search_
guild_ members_ limit - Ensure that the limit for the Search Guild Members endpoint is correct.
- stage_
topic - Ensure that the stage instance’s topic length is correct.
- template_
description - Ensure that a guild template’s description length is correct.
- template_
name - Ensure that a guild template’s name length is correct.
- username
- Ensure that a username is correct.
- webhook_
username - Ensure that a webhook is correct.