Enumerations
The API provides some enumerations for certain types of strings to avoid the API from being stringly typed in case the strings change in the future.
All enumerations are subclasses of an internal class which mimics the behaviour
of enum.Enum.
Hint
You can use any of the enum classe members as an attribute of an instance of it to get a bool
whether the instance has this value.
Example:
# channel could be any channel like object
if channel.type.private: # True if channel is a DMChannel
...
# This is the same as
if channel.type == discord.ChannelType.private:
...
- class discord.MessageType
Specifies the type of
Message. This is used to denote if a message is to be interpreted as a system message or a regular message.- x == y
Checks if two messages are equal.
- x != y
Checks if two messages are not equal.
- recipient_add
The system message when a recipient is added to a group private message, i.e. a private channel of type
ChannelType.group.
- recipient_remove
The system message when a recipient is removed from a group private message, i.e. a private channel of type
ChannelType.group.
The system message denoting that a member has “nitro boosted” a guild.
The system message denoting that a member has “nitro boosted” a guild and it achieved level 1.
The system message denoting that a member has “nitro boosted” a guild and it achieved level 2.
The system message denoting that a member has “nitro boosted” a guild and it achieved level 3.
- channel_follow_add
The system message denoting that an announcement channel has been followed.
Added in version 1.3.
- guild_stream
The system message denoting that a member is streaming in the guild.
Added in version 1.7.
- guild_discovery_disqualified
The system message denoting that the guild is no longer eligible for Server Discovery.
Added in version 1.7.
- guild_discovery_requalified
The system message denoting that the guild has become eligible again for Server Discovery.
Added in version 1.7.
- guild_discovery_grace_period_initial_warning
The system message denoting that the guild has failed to meet the Server Discovery requirements for one week.
Added in version 1.7.
- guild_discovery_grace_period_final_warning
The system message denoting that the guild has failed to meet the Server Discovery requirements for 3 weeks in a row.
Added in version 1.7.
- guild_invite_reminder
The system message denoting that a guild invite reminder has been sent.
Added in version 2.0.
A message that is a context menu command.
Added in version 2.0.
- role_subscription_purchase
A message informing about a role subscription purchase.
Added in version 2.0.
A message informing about a premium upsell.
Added in version 2.0.
- stage_raise_hand
A message informing about someone raising their hand in a stage.
Added in version 2.0.
- stage_topic_change
A message informing about the topic of a stage been changed.
Added in version 2.0.
The system message denoting that a member has subscribed to a guild application.
Added in version 2.4.
- class discord.ReactionType
The type of a
Reaction.Added in version 2.0.
- class discord.SelectDefaultValueType
- user
The
idrepresents a user, only valid forUserSelectandMentionableSelect
- role
The
idrepresents a role, only valid forRoleSelectandMentionableSelect
- channel
The
idrepresents a channel, only valid forChannelSelect
- class discord.ButtonStyle
The possible styles for a
Button
- class discord.InteractionType
Specifies the type of an interaction received from discord.
- PingAck
A ping interaction, those are only used for http-only interactions which are currently not supported by discord4py.
- class discord.InteractionCallbackType
InteractionCallbackType to react to an
BaseInteractionNAME
VALUE
DESCRIPTION
USAGE
EXAMPLE
1
ACK a
PingACK a Ping to Discord
~
4
respond to an interaction with a message
Interaction.respondClick to view example
5
ACK an interaction and edit a response later, the user sees a loading state
Possible
response_typefor _deferClick to view example
6
for components, ACK an interaction and edit the original message later; the user does not see a loading state
Possible
response_typefor _deferClick to view example
7
for components, edit the message the component was attached to
Interaction.editClick to view example
(Autocomplete and Modal are missing here)
- class discord.InteractionContextType
Context in Discord where an interaction can be used, or where it was triggered from.
Added in version 2.0.
See also
contextto check where the interaction was triggered fromcontextparameter inslash_command(),user_command()andmessage_command()as well as their respective Cog methods
- class discord.AppIntegrationType
Where an app can be installed More info. Also used in app-commands to specify in which present context the command can be used.
Added in version 2.0.
- class discord.EntryPointHandlerType
How a
PrimaryEntryPointCommandis handled.Added in version 2.0.
- discord_launch_activity
Discord handles the interaction by launching your apps activity and sending a follow-up message without coordinating with the app.
- self
An alias for
app_handler
- discord
An alias for
discord_launch_activity
- class discord.Locale
Valid locals that are used at different places in the discord api.
Note
Usually you can use the lowercase
Language Name(spaces replaced with underscores) as a valid locale too.Locale
Language Name
Native Name
Danish
Dansk
German
Deutsch
English, UK
English, UK
English, US
English, US
Spanish
Español
French
Français
Croatian
Hrvatski
Italian
Italiano
Lithuanian
Lietuviškai
Hungarian
Magyar
Dutch
Nederlands
Norwegian
Norsk
Polish
Polski
Portuguese/Brazilian
Português do Brasil
Romanian, Romania
Română
Finnish
Suomi
Swedish
Svenska
Vietnamese
Tiếng Việt
Turkish
Türkçe
Czech
Čeština
Greek
Ελληνικά
Bulgarian
български
Russian
Pусский
Ukrainian
Українська
Hindi
हिन्दी
Thai
ไทย
Chinese, China
中文
Japanese
日本語
Chinese, Taiwan
繁體中文
Korean
한국어
- class discord.ActivityType
Specifies the type of
Activity. This is used to check how to interpret the activity itself.
- class discord.VoiceRegion
Specifies the region a voice server belongs to.
Note
If you wan't to fetch all currently available voice regions, consider using
Client.fetch_voice_regions().
- class discord.VideoQualityMode
Specifies the camera video quality for all channel participants in a
VoiceChannel/StageChannel.
- class discord.VerificationLevel
Specifies a
Guild's verification level, which is the criteria in which a member must meet before being able to send messages to the guild.- x == y
Checks if two verification levels are equal.
- x != y
Checks if two verification levels are not equal.
- x > y
Checks if a verification level is higher than another.
- x < y
Checks if a verification level is lower than another.
- x >= y
Checks if a verification level is higher or equal to another.
- x <= y
Checks if a verification level is lower or equal to another.
- high
Member must have a verified email, be registered on Discord for more than five minutes, and be a member of the guild itself for more than ten minutes.
- table_flip
An alias for
high.
- double_table_flip
An alias for
extreme.
- very_high
An alias for
extreme.Added in version 1.4.
- class discord.NotificationLevel
Specifies whether a
Guildhas notifications on for all messages or mentions only by default.
- class discord.ContentFilter
Specifies a
Guild's explicit content filter, which is the machine learning algorithms that Discord uses to detect if an image contains pornography or otherwise explicit content.- x == y
Checks if two content filter levels are equal.
- x != y
Checks if two content filter levels are not equal.
- x > y
Checks if a content filter level is higher than another.
- x < y
Checks if a content filter level is lower than another.
- x >= y
Checks if a content filter level is higher or equal to another.
- x <= y
Checks if a content filter level is lower or equal to another.
- class discord.Status
Specifies a
Member‘s status.- do_not_disturb
An alias for
dnd.
- invisible
The member is “invisible”. In reality, this is only used in sending a presence a la
Client.change_presence(). When you receive a user’s presence this will beofflineinstead.
- class discord.AuditLogAction
Represents the type of action being done for a
AuditLogEntry, which is retrievable viaGuild.audit_logs().- guild_update
The guild has updated. Things that trigger this include:
Changing the guild vanity URL
Changing the guild invite splash
Changing the guild AFK channel or timeout
Changing the guild voice server region
Changing the guild icon
Changing the guild moderation settings
Changing things related to the guild widget
When this is the action, the type of
targetis theGuild.Possible attributes for
AuditLogDiff:
- channel_create
A new channel was created.
When this is the action, the type of
targetis either aabc.GuildChannelorObjectwith an ID.A more filled out object in the
Objectcase can be found by usingafter.Possible attributes for
AuditLogDiff:
- channel_update
A channel was updated. Things that trigger this include:
The channel name or topic was changed
The channel bitrate was changed
When this is the action, the type of
targetis theabc.GuildChannelorObjectwith an ID.A more filled out object in the
Objectcase can be found by usingafterorbefore.Possible attributes for
AuditLogDiff:
- channel_delete
A channel was deleted.
When this is the action, the type of
targetis anObjectwith an ID.A more filled out object can be found by using the
beforeobject.Possible attributes for
AuditLogDiff:
- overwrite_create
A channel permission overwrite was created.
When this is the action, the type of
targetis theabc.GuildChannelorObjectwith an ID.When this is the action, the type of
extrais either aRoleorMember. If the object is not found then it is aObjectwith an ID being filled, a name, and atypeattribute set to either'role'or'member'to help dictate what type of ID it is.Possible attributes for
AuditLogDiff:
- overwrite_update
A channel permission overwrite was changed, this is typically when the permission values change.
See
overwrite_createfor more information on how thetargetandextrafields are set.Possible attributes for
AuditLogDiff:
- overwrite_delete
A channel permission overwrite was deleted.
See
overwrite_createfor more information on how thetargetandextrafields are set.Possible attributes for
AuditLogDiff:
- kick
A member was kicked.
When this is the action, the type of
targetis theUserwho got kicked.When this is the action,
changesis empty.
- member_prune
A member prune was triggered.
When this is the action, the type of
targetis set toNone.When this is the action, the type of
extrais set to an unspecified proxy object with two attributes:delete_members_days: An integer specifying how far the prune was.members_removed: An integer specifying how many members were removed.
When this is the action,
changesis empty.
- ban
A member was banned.
When this is the action, the type of
targetis theUserwho got banned.When this is the action,
changesis empty.
- unban
A member was unbanned.
When this is the action, the type of
targetis theUserwho got unbanned.When this is the action,
changesis empty.
- member_update
A member has updated. This triggers in the following situations:
A nickname was changed
They were server muted or deafened (or it was undo’d)
When this is the action, the type of
targetis theMemberorUserwho got updated.Possible attributes for
AuditLogDiff:
- member_role_update
A member’s role has been updated. This triggers when a member either gains a role or losses a role.
When this is the action, the type of
targetis theMemberorUserwho got the role.Possible attributes for
AuditLogDiff:
- member_move
A member’s voice channel has been updated. This triggers when a member is moved to a different voice channel.
When this is the action, the type of
extrais set to an unspecified proxy object with two attributes:channel: ATextChannelorObjectwith the channel ID where the members were moved.count: An integer specifying how many members were moved.
Added in version 1.3.
- member_disconnect
A member’s voice state has changed. This triggers when a member is force disconnected from voice.
When this is the action, the type of
extrais set to an unspecified proxy object with one attribute:count: An integer specifying how many members were disconnected.
Added in version 1.3.
- bot_add
A bot was added to the guild.
When this is the action, the type of
targetis theMemberorUserwhich was added to the guild.Added in version 1.3.
- role_create
A new role was created.
When this is the action, the type of
targetis theRoleor aObjectwith the ID.Possible attributes for
AuditLogDiff:
- role_update
A role was updated. This triggers in the following situations:
The name has changed
The permissions have changed
The colour has changed
Its hoist/mentionable state has changed
When this is the action, the type of
targetis theRoleor aObjectwith the ID.Possible attributes for
AuditLogDiff:
- role_delete
A role was deleted.
When this is the action, the type of
targetis theRoleor aObjectwith the ID.Possible attributes for
AuditLogDiff:
- invite_create
An invite was created.
When this is the action, the type of
targetis theInvitethat was created.Possible attributes for
AuditLogDiff:
- invite_update
An invite was updated.
When this is the action, the type of
targetis theInvitethat was updated.
- invite_delete
An invite was deleted.
When this is the action, the type of
targetis theInvitethat was deleted.Possible attributes for
AuditLogDiff:
- webhook_create
A webhook was created.
When this is the action, the type of
targetis theObjectwith the webhook ID.Possible attributes for
AuditLogDiff:
- webhook_update
A webhook was updated. This trigger in the following situations:
The webhook name changed
The webhook channel changed
When this is the action, the type of
targetis theObjectwith the webhook ID.Possible attributes for
AuditLogDiff:
- webhook_delete
A webhook was deleted.
When this is the action, the type of
targetis theObjectwith the webhook ID.Possible attributes for
AuditLogDiff:
- emoji_create
An emoji was created.
When this is the action, the type of
targetis theEmojiorObjectwith the emoji ID.Possible attributes for
AuditLogDiff:
- emoji_update
An emoji was updated. This triggers when the name has changed.
When this is the action, the type of
targetis theEmojiorObjectwith the emoji ID.Possible attributes for
AuditLogDiff:
- emoji_delete
An emoji was deleted.
When this is the action, the type of
targetis theObjectwith the emoji ID.Possible attributes for
AuditLogDiff:
- message_delete
A message was deleted by a moderator. Note that this only triggers if the message was deleted by someone other than the author.
When this is the action, the type of
targetis theMemberorUserwho had their message deleted.When this is the action, the type of
extrais set to an unspecified proxy object with two attributes:count: An integer specifying how many messages were deleted.channel: ATextChannelorObjectwith the channel ID where the message got deleted.
- message_bulk_delete
Messages were bulk deleted by a moderator.
When this is the action, the type of
targetis theTextChannelorObjectwith the ID of the channel that was purged.When this is the action, the type of
extrais set to an unspecified proxy object with one attribute:count: An integer specifying how many messages were deleted.
Added in version 1.3.
- message_pin
A message was pinned in a channel.
When this is the action, the type of
targetis theMemberorUserwho had their message pinned.When this is the action, the type of
extrais set to an unspecified proxy object with two attributes:channel: ATextChannelorObjectwith the channel ID where the message was pinned.message_id: the ID of the message which was pinned.
Added in version 1.3.
- message_unpin
A message was unpinned in a channel.
When this is the action, the type of
targetis theMemberorUserwho had their message unpinned.When this is the action, the type of
extrais set to an unspecified proxy object with two attributes:channel: ATextChannelorObjectwith the channel ID where the message was unpinned.message_id: the ID of the message which was unpinned.
Added in version 1.3.
- integration_create
A guild integration was created.
When this is the action, the type of
targetis theObjectwith the integration ID of the integration which was created.Added in version 1.3.
- class discord.AuditLogActionCategory
Represents the category that the
AuditLogActionbelongs to.This can be retrieved via
AuditLogEntry.category.
- class discord.PremiumType
Represents the user’s Discord Nitro subscription type.
Deprecated since version 1.7.
Note
This only applies to users, not bots.
- class discord.Theme
Represents the theme synced across all Discord clients.
Deprecated since version 1.7.
Note
This only applies to users, not bots.
- class discord.TeamMembershipState
Represents the membership state of a team member retrieved through
Bot.application_info().Added in version 1.3.
- TeamRole:
A
TeamMembercan be one of four roles (owner, admin, developer, and read-only), and each role inherits the access of those below it. Represents the role of a team member retrieved throughBot.application_info().Added in version 2.0.
- discord.owner
Owners are the most permissiable role, and can take destructive, irreversible actions like deleting team-owned apps or the team itself. Teams are limited to 1 owner.
- discord.admin
Admins have similar access as an
owner, except they cannot take destructive actions on the team or team-owned apps.
- discord.developer
Developers can access information about team-owned apps, like the client secret or public key. They can also take limited actions on team-owned apps, like configuring interaction endpoints or resetting the bot token. Members with the Developer role cannot manage the team or its members, or take destructive actions on team-owned apps.
- class discord.WebhookType
Represents the type of webhook that can be received.
Added in version 1.3.
- class discord.TimestampStyle
The Styles you could use for the
styleof adiscord.utils.styled_timestamp()See also in the Discord-Documentation
- class discord.ExpireBehaviour
Represents the behaviour the
Integrationshould perform when a user’s subscription has finished.There is an alias for this called
ExpireBehavior.Added in version 1.4.
- class discord.DefaultAvatar
Represents the default avatar of a Discord
User- blurple
Represents the default avatar with the color blurple. See also
Colour.blurple
- grey
Represents the default avatar with the color grey. See also
Colour.greyple
- gray
An alias for
grey.
- green
Represents the default avatar with the color green. See also
Colour.green
- orange
Represents the default avatar with the color orange. See also
Colour.orange
- red
Represents the default avatar with the color red. See also
Colour.red
- class discord.EventEntityType
The location where a
GuildScheduledEventwill be scheduled at
- class discord.EventStatus
The status of a
GuildScheduledEventNote
* Once
statusis set tocompletedorcanceled, thestatuscan no longer be updatedValid Guild Scheduled Event Status Transitions
scheduled–>activeactive——–>completedscheduled–>canceled
- class discord.AutoModEventType
Indicates in what event context a
AutoModRuleshould be checked.
- class discord.AutoModActionType
The type of action that should be taken in an
AutoModAction.- timeout_user
Timeout the user for a specific duration
Note
This can only be used when the
trigger_typeiskeywordormention_spam
- class discord.TextInputStyle
The style a
TextInputshould have- singleline
An aliase for
short
- multiline
An aliase for
paragraph
- class discord.OptionType
Option types for
SlashCommandOption- string
A string (
str)
- integer
Any integer between -2^53 and 2^53 (
int)
- boolean
A boolean (
bool)
- channel
Includes all channel types + categories
Note
To only accept specific channel types use
SlashCommandOption.channel_types
- role
A role (
Role)
- number
Any double between -2^53 and 2^53 (
float)
- attachment
An
Attachment
- class discord.PostSortOrder
Type used to order posts in
ForumChannelchannels.
- class discord.OnboardingMode
Defines the criteria used to satisfy Onboarding constraints that are required for enabling.
- class discord.SKUType
Represents the type of a
SKU.- subscription_group
System-generated group for each
subscriptionSKU created
- class discord.EntitlementType
Represents the type of a
Entitlement.Entitlement for Discord Nitro subscription
Entitlement was claimed by user for free as a Nitro Subscriber
- class discord.SubscriptionStatus
Represent the
statusof a subscription.