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.ChannelType

Specifies the type of channel.

text

A text channel.

voice

A voice channel.

private

A private text channel. Also called a direct message.

group

A private group text channel.

category

A category channel.

news

A guild news channel.

store

A guild store channel.

stage_voice

A guild stage voice channel.

Added in version 1.7.

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.

default

The default message type. This is the same as regular messages.

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.

call

The system message denoting call state, e.g. missed call, started call, etc.

channel_name_change

The system message denoting that a channel’s name has been changed.

channel_icon_change

The system message denoting that a channel’s icon has been changed.

pins_add

The system message denoting that a pinned message has been added to a channel.

new_member

The system message denoting that a new member has joined a Guild.

premium_guild_subscription

The system message denoting that a member has “nitro boosted” a guild.

premium_guild_tier_1

The system message denoting that a member has “nitro boosted” a guild and it achieved level 1.

premium_guild_tier_2

The system message denoting that a member has “nitro boosted” a guild and it achieved level 2.

premium_guild_tier_3

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.

thread_created

The system message denoting that a thread has been created.

Added in version 2.0.

reply

A message that is a reply to another message.

Added in version 2.0.

chat_input_command

A message that is a slash command.

Added in version 2.0.

thread_starter_message

A message that is the first message in a thread.

Added in version 2.0.

guild_invite_reminder

The system message denoting that a guild invite reminder has been sent.

Added in version 2.0.

context_menu_command

A message that is a context menu command.

Added in version 2.0.

automoderation_action

A log message from discords auto moderation system.

Added in version 2.0.

role_subscription_purchase

A message informing about a role subscription purchase.

Added in version 2.0.

interaction_premium_upsell

A message informing about a premium upsell.

Added in version 2.0.

stage_start

A message informing about a stage starting.

Added in version 2.0.

stage_end

A message informing about a stage ending.

Added in version 2.0.

stage_speaker_change

A message informing about a stage having a new speaker.

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.

guild_application_premium_subscription

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.

normal

A normal reaction

burst

A burst reaction.

class discord.ComponentType
ActionRow

Container for other components

Button

Button object

StringSelect

Select menu for picking from defined text options

TextInput

Text input object

UserSelect

Select menu for users

RoleSelect

Select menu for roles

MentionableSelect

Select menu for mentionables (users and roles)

ChannelSelect

Select menu for channels

class discord.SelectDefaultValueType
user

The id represents a user, only valid for UserSelect and MentionableSelect

role

The id represents a role, only valid for RoleSelect and MentionableSelect

channel

The id represents a channel, only valid for ChannelSelect

class discord.ButtonStyle

The possible styles for a Button

NAME

VALUE

ALIASES

EXAMPLE

blurple

1

Primary

Blurple Button Picture
grey

2

gray, Secondary

Grey Button Picture
green

3

Success

Green Button Picture
red

4

Danger

Red Button Picture
url

5

link, grey_url, Link_Button

URL Button Picture
class discord.InteractionType

Specifies the type of an interaction received from discord.

PingAck

A ping interaction, those are only used for http-only interactions wich are currently not supported by discord4py.

ApplicationCommand

A user invoked a slash, user or message command.

Component

A user pressed a button, or submitted a select menu.

ApplicationCommandAutocomplete

Sent regularly when a user is filling out a slash-command option, that has autocomplete enabled.

ModalSubmit

A user submitted a modal.

class discord.InteractionCallbackType

InteractionCallbackType to react to an BaseInteraction

NAME

VALUE

DESCRIPTION

USAGE

EXAMPLE

pong

1

ACK a Ping

ACK a Ping to Discord

~

msg_with_source

4

respond to an interaction with a message

Interaction.respond

Click to view example

Example for msg_with_source
deferred_msg_with_source

5

ACK an interaction and edit a response later, the user sees a loading state

Possible response_type for _defer

Click to view example

Example for deferred_msg_with_source
deferred_update_msg

6

for components, ACK an interaction and edit the original message later; the user does not see a loading state

Possible response_type for _defer

Click to view example

Example for deferred_update_msg
update_msg

7

for components, edit the message the component was attached to

Interaction.edit

Click to view example

Example for update_msg
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

da

Danish

Dansk

de

German

Deutsch

en_GB

English, UK

English, UK

en_US

English, US

English, US

es_ES

Spanish

Español

fr

French

Français

hr

Croatian

Hrvatski

it

Italian

Italiano

lt

Lithuanian

Lietuviškai

hu

Hungarian

Magyar

nl

Dutch

Nederlands

no

Norwegian

Norsk

pl

Polish

Polski

pt_BR

Portuguese/Brazilian

Português do Brasil

ro

Romanian, Romania

Română

fi

Finnish

Suomi

sv_SE

Swedish

Svenska

vi

Vietnamese

Tiếng Việt

tr

Turkish

Türkçe

cs

Czech

Čeština

el

Greek

Ελληνικά

bg

Bulgarian

български

ru

Russian

Pусский

uk

Ukrainian

Українська

hi

Hindi

हिन्दी

th

Thai

ไทย

zh_CN

Chinese, China

中文

ja

Japanese

日本語

zh_TW

Chinese, Taiwan

繁體中文

ko

Korean

한국어

class discord.ActivityType

Specifies the type of Activity. This is used to check how to interpret the activity itself.

unknown

An unknown activity type. This should generally not happen.

playing

A “Playing” activity type.

streaming

A “Streaming” activity type.

listening

A “Listening” activity type.

watching

A “Watching” activity type.

custom

A custom activity type.

competing

A competing activity type.

Added in version 1.5.

class discord.HypeSquadHouse

Specifies the HypeSquad house a user belongs to.

bravery

The “Bravery” house.

brilliance

The “Brilliance” house.

balance

The “Balance” house.

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().

amsterdam

The Amsterdam region.

brazil

The Brazil region.

dubai

The Dubai region.

Added in version 1.3.

eu_central

The EU Central region.

eu_west

The EU West region.

europe

The Europe region.

Added in version 1.3.

frankfurt

The Frankfurt region.

hongkong

The Hong Kong region.

india

The India region.

Added in version 1.2.

japan

The Japan region.

london

The London region.

russia

The Russia region.

singapore

The Singapore region.

southafrica

The South Africa region.

south_korea

The South Korea region.

sydney

The Sydney region.

us_central

The US Central region.

us_east

The US East region.

us_south

The US South region.

us_west

The US West region.

vip_amsterdam

The Amsterdam region for VIP guilds.

vip_us_east

The US East region for VIP guilds.

vip_us_west

The US West region for VIP guilds.

class discord.VideoQualityMode

Specifies the camera video quality for all channel participants in a VoiceChannel / StageChannel.

auto
Automatic set per-user for optimal performance.
full

The quality is enforced to 720p for all participants.

720p
An aliase to :attr:`.full`
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.

none

No criteria set.

low

Member must have a verified email on their Discord account.

medium

Member must have a verified email and be registered on Discord for more than five minutes.

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.

extreme

Member must have a verified phone on their Discord account.

double_table_flip

An alias for extreme.

very_high

An alias for extreme.

Added in version 1.4.

class discord.NotificationLevel

Specifies whether a Guild has notifications on for all messages or mentions only by default.

all_messages

Members receive notifications for every message regardless of them being mentioned.

only_mentions

Members receive notifications for messages they are mentioned in.

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.

disabled

The guild does not have the content filter enabled.

no_role

The guild has the content filter enabled for members without a role.

all_members

The guild has the content filter enabled for every member.

class discord.Status

Specifies a Member ‘s status.

online

The member is online.

offline

The member is offline.

idle

The member is idle.

dnd

The member is “Do Not Disturb”.

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 be offline instead.

class discord.AuditLogAction

Represents the type of action being done for a AuditLogEntry, which is retrievable via Guild.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 target is the Guild.

Possible attributes for AuditLogDiff:

channel_create

A new channel was created.

When this is the action, the type of target is either a abc.GuildChannel or Object with an ID.

A more filled out object in the Object case can be found by using after.

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 target is the abc.GuildChannel or Object with an ID.

A more filled out object in the Object case can be found by using after or before.

Possible attributes for AuditLogDiff:

channel_delete

A channel was deleted.

When this is the action, the type of target is an Object with an ID.

A more filled out object can be found by using the before object.

Possible attributes for AuditLogDiff:

overwrite_create

A channel permission overwrite was created.

When this is the action, the type of target is the abc.GuildChannel or Object with an ID.

When this is the action, the type of extra is either a Role or Member. If the object is not found then it is a Object with an ID being filled, a name, and a type attribute 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_create for more information on how the target and extra fields are set.

Possible attributes for AuditLogDiff:

overwrite_delete

A channel permission overwrite was deleted.

See overwrite_create for more information on how the target and extra fields are set.

Possible attributes for AuditLogDiff:

kick

A member was kicked.

When this is the action, the type of target is the User who got kicked.

When this is the action, changes is empty.

member_prune

A member prune was triggered.

When this is the action, the type of target is set to None.

When this is the action, the type of extra is 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, changes is empty.

ban

A member was banned.

When this is the action, the type of target is the User who got banned.

When this is the action, changes is empty.

unban

A member was unbanned.

When this is the action, the type of target is the User who got unbanned.

When this is the action, changes is 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 target is the Member or User who 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 target is the Member or User who 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 extra is set to an unspecified proxy object with two attributes:

  • channel: A TextChannel or Object with 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 extra is 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 target is the Member or User which 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 target is the Role or a Object with 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 target is the Role or a Object with the ID.

Possible attributes for AuditLogDiff:

role_delete

A role was deleted.

When this is the action, the type of target is the Role or a Object with the ID.

Possible attributes for AuditLogDiff:

invite_create

An invite was created.

When this is the action, the type of target is the Invite that was created.

Possible attributes for AuditLogDiff:

invite_update

An invite was updated.

When this is the action, the type of target is the Invite that was updated.

invite_delete

An invite was deleted.

When this is the action, the type of target is the Invite that was deleted.

Possible attributes for AuditLogDiff:

webhook_create

A webhook was created.

When this is the action, the type of target is the Object with 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 target is the Object with the webhook ID.

Possible attributes for AuditLogDiff:

webhook_delete

A webhook was deleted.

When this is the action, the type of target is the Object with the webhook ID.

Possible attributes for AuditLogDiff:

emoji_create

An emoji was created.

When this is the action, the type of target is the Emoji or Object with 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 target is the Emoji or Object with the emoji ID.

Possible attributes for AuditLogDiff:

emoji_delete

An emoji was deleted.

When this is the action, the type of target is the Object with 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 target is the Member or User who had their message deleted.

When this is the action, the type of extra is set to an unspecified proxy object with two attributes:

  • count: An integer specifying how many messages were deleted.

  • channel: A TextChannel or Object with 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 target is the TextChannel or Object with the ID of the channel that was purged.

When this is the action, the type of extra is 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 target is the Member or User who had their message pinned.

When this is the action, the type of extra is set to an unspecified proxy object with two attributes:

  • channel: A TextChannel or Object with 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 target is the Member or User who had their message unpinned.

When this is the action, the type of extra is set to an unspecified proxy object with two attributes:

  • channel: A TextChannel or Object with 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 target is the Object with the integration ID of the integration which was created.

Added in version 1.3.

integration_update

A guild integration was updated.

When this is the action, the type of target is the Object with the integration ID of the integration which was updated.

Added in version 1.3.

integration_delete

A guild integration was deleted.

When this is the action, the type of target is the Object with the integration ID of the integration which was deleted.

Added in version 1.3.

class discord.AuditLogActionCategory

Represents the category that the AuditLogAction belongs to.

This can be retrieved via AuditLogEntry.category.

create

The action is the creation of something.

delete

The action is the deletion of something.

update

The action is the update of something.

class discord.PremiumType

Represents the user’s Discord Nitro subscription type.

Deprecated since version 1.7.

Note

This only applies to users, not bots.

nitro

Represents the Discord Nitro with Nitro-exclusive games.

nitro_classic

Represents the Discord Nitro with no Nitro-exclusive games.

class discord.Theme

Represents the theme synced across all Discord clients.

Deprecated since version 1.7.

Note

This only applies to users, not bots.

light

Represents the Light theme on Discord.

dark

Represents the Dark theme on Discord.

class discord.TeamMembershipState

Represents the membership state of a team member retrieved through Bot.application_info().

Added in version 1.3.

invited

Represents an invited member.

accepted

Represents a member currently in the team.

TeamRole:

A TeamMember can 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 through Bot.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.

discord.read_only

Read-only members can access information about a team and any team-owned apps. Some examples include getting the IDs of applications and exporting payout records.

class discord.WebhookType

Represents the type of webhook that can be received.

Added in version 1.3.

incoming

Represents a webhook that can post messages to channels with a token.

channel_follower

Represents a webhook that is internally managed by Discord, used for following channels.

class discord.TimestampStyle

The Styles you could use for the style of a discord.utils.styled_timestamp()

See also in the Discord-Documentation

NAME

VALUE

DESCRIPTION

EXAMPLE

short_time

‘t’

Short Time

../_images/short_time.png
long_time

‘T’

Long Time

../_images/long_time.png
short_date

‘d’

Short Date

../_images/short_date.png
long_date

‘D’

Long Date

../_images/long_date.png
short

‘f’

Short Date/Time

../_images/short.png
long

‘F’

Long Date/Time

../_images/long.png
relative

‘R’

Relative Time

../_images/relative.png
class discord.ExpireBehaviour

Represents the behaviour the Integration should perform when a user’s subscription has finished.

There is an alias for this called ExpireBehavior.

Added in version 1.4.

remove_role

This will remove the Integration.role from the user when their subscription is finished.

kick

This will kick the user when their subscription is finished.

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

pink

Represents the default avatar with the color pink.

class discord.StickerType

Represents the type of sticker images.

Added in version 1.6.

png

Represents a sticker with a png image.

apng

Represents a sticker with an apng image.

lottie

Represents a sticker with a lottie image.

gif

Represents a sticker with a gif image.

class discord.EventEntityType

The location where a GuildScheduledEvent will be scheduled at

stage

The event wil be in a stage channel

voice

The event wil be in a voice channel

external

The event wil be outside of discord, like on a website or in the real world

class discord.EventStatus

The status of a GuildScheduledEvent

scheduled

The event hasn’t startet yet

active

The event is currently active

completed

The event is over

canceled

The scheduled event was canceled

Note

* Once status is set to completed or canceled, the status can no longer be updated

Valid Guild Scheduled Event Status Transitions

  • scheduled –> active

  • active ——–> completed

  • scheduled –> canceled

class discord.AutoModEventType

Indicates in what event context a AutoModRule should be checked.

message_send

When a member sends or edits a message (in the guild the rule belongs to)

class discord.AutoModKeywordPresetType
profanity

Words that may be considered forms of swearing or cursing

sexual_content

Words that refer to sexually explicit behavior or activity

slurs

Personal insults or words that may be considered hate speech

class discord.AutoModTriggerType

Characterizes the type of content which can trigger the rule.

keyword

Check if content contains words from a user defined list of keywords

spam

Check if content represents generic spam

keyword_preset

Check if content contains words from internal pre-defined wordsets

class discord.AutoModActionType

The type of action that should be taken in an AutoModAction.

block_message

Blocks the content of a message according to the rule

send_alert_message

Logs user content to a specified channel

timeout_user

Timeout the user for a specific duration

Note

This can only be used when the trigger_type is keyword

class discord.TextInputStyle

The style a TextInput should have

short

A single-line input

singleline

An aliase for short

paragraph

A multi-line input

multiline

An aliase for paragraph

class discord.OptionType

Option types for SlashCommandOption

sub_command

A sub command. Internal use only.

sub_command_group

A sub command group. Internal use only.

string

A string (str)

integer

Any integer between -2^53 and 2^53 (int)

boolean

A boolean (bool)

user

A user/member (User/Member)

channel

Includes all channel types + categories

Note

To only accept specific channel types use SlashCommandOption.channel_types

role

A role (Role)

mentionable

Includes user and roles (User/Member & Role)

number

Any double between -2^53 and 2^53 (float)

attachment

An Attachment

class discord.PostSortOrder

Type used to order posts in ForumChannel channels.

latest_activity

Sort forum posts by activity

creation_date

Sort forum posts by creation time (from most recent to oldest)

class discord.ForumLayout

Type used to display posts in ForumChannel channels.

not_set

No default has been set for forum channel

list_view

Display posts as a list

gallery_view

Display posts as a collection of tiles (grid)

class discord.OnboardingMode

Defines the criteria used to satisfy Onboarding constraints that are required for enabling.

default

Counts only Default Channels towards constraints

advanced

Counts Default Channels and Questions towards constraints

class discord.OnboardingPromptType

Defines the way a prompts’ options are displayed.

multiple_choice

The options are displayed as a grid of buttons

dropdown

The options are displayed in a dropdown menu

class discord.SKUType

Represents the type of a SKU.

subscription

Represents a recurring subscription

subscription_group

System-generated group for each SUBSCRIPTION SKU created