Module request

Source
Expand description

Contains all other input validation functions.

These functions are generally not related to a specific Discord model.

Structs§

ValidationError
A field is not valid.

Enums§

ValidationErrorType
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 to 28 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 to 7 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.