Enumerations¶
- class discord.enums.ApplicationEventWebhookStatus[source]¶
Status indicating whether event webhooks are enabled or disabled for an application
- class discord.flags.ApplicationFlag[source]¶
- APPLICATION_AUTO_MODERATION_RULE_CREATE_BADGE: int = 64¶
Indicates if an app uses the Auto Moderation API
- APPLICATION_COMMAND_BADGE: int = 8388608¶
Indicates if an app has registered global application commands
- EMBEDDED: int = 131072¶
Indicates if an app is embedded within the Discord client (currently unavailable publicly)
- GATEWAY_GUILD_MEMBERS: int = 16384¶
Intent requried for bots in 100 or more servers to receive member-related events like
guild_member_add
- GATEWAY_GUILD_MEMBERS_LIMITED: int = 32768¶
Intent required for bots in under 100 servers to receive member-related events like
guild_member_add, found on the Bot page in your app’s settings
- GATEWAY_MESSAGE_CONTENT: int = 262144¶
Intent required for bots in 100 or more servers to receive message content
- GATEWAY_MESSAGE_CONTENT_LIMITED: int = 524288¶
Intent required for bots in under 100 servers to receive message content, found on the Bot page in your app’s settings
- GATEWAY_PRESENCE: int = 4096¶
Intent required for bots in 100 or more servers to receive
presence_updateevents
- class discord.enums.ApplicationIntegrationType[source]¶
Where an app can be installed, also called its supported installation contexts.
- class discord.enums.AutoModerationActionType[source]¶
-
- BLOCK_MESSAGE: int = 1¶
Blocks a member’s message and prevents it from being posted. A custom explanation can be specified and shown to members whenever their message is blocked.
- TIMEOUT: int = 3¶
Timeout user for a specified duration.
Important
Can only be set up for
KEYWORDandMENTION_SPAMrules. TheMODERATE_MEMBERSpermission is required to use theTIMEOUTaction type.
- class discord.enums.AutoModerationRuleEventType[source]¶
Indicates in what event context a rule should be checked.
- class discord.enums.AutoModerationRuleTriggerType[source]¶
Characterizes the type of content which can trigger the rule.
- KEYWORD: int = 1¶
Check if content contains words from a user-defined list of keywords.
Max per Guild: 6
- KEYWORD_PRESET: int = 4¶
Check if content contains words from internal pre-defined words.
Max per Guild: 1
- MEMBER_PROFILE: int = 6¶
Check if member profile contains words from a user-defined list of keywords.
Max per Guild: 1
- class discord.flags.ChannelFlag[source]¶
- HIDE_MEDIA_DOWNLOAD_OPTIONS: int = 32768¶
When set hides the embedded media download options. Available only for media channels
- IS_SPOILER_CHANNEL: int = 2097152¶
This channel is a Spoiler Channel i.e. users must opt-in to view its contents. Can be set on all textual guild channels and voice channels (not
GUILD_STAGE). Can only be set if channel’snsfwisFalse
- PINNED: int = 2¶
This thread is pinned to the top of its parent
GUILD_FORUMorGUILD_MEDIAchannel
- REQUIRE_TAG: int = 16¶
Whether a tag is required to be specified when creating a thread in a
GUILD_FORUMor aGUILD_MEDIAchannel. Tags are specified in theapplied_tagsfield
- class discord.enums.ChannelType[source]¶
- ANNOUNCEMENT_THREAD: int = 10¶
A temporary sub-channel within a
GUILD_ANNOUNCEMENTchannel.
- GUILD_ANNOUNCEMENT: int = 5¶
A channel that users can follow and crosspost into their own server (formerly news channels).
- GUILD_MEDIA: int = 16¶
Channel that can only contain threads, similar to
GUILD_FORUMchannels.
- PRIVATE_THREAD: int = 12¶
A temporary sub-channel within a
GUILD_TEXTchannel that is only viewable by those invited and those with theMANAGE_THREADSpermission.
- PUBLIC_THREAD: int = 11¶
A temporary sub-channel within a
GUILD_TEXTorGUILD_FORUMchannel.
- class discord.flags.GatewayIntent[source]¶
Represents a set of Gateway intents.
Note
Thread Members Update contains different data depending on which intents are used.
Important
Events under the
GUILD_PRESENCESandGUILD_MEMBERSintents are turned off by default on all API versions. If you are using API v6, you will receive those events if you are authorized to receive them and have enabled the intents in the Developer Portal. You do not need to use intents on API v6 to receive these events; you just need to enable the flags. If you are using API v8 or above, intents are mandatory and must be specified when identifying.Hint
MESSAGE_CONTENTdoes not represent individual events, but rather affects what data is present for events that could contain message content fields.- AUTO_MODERATION_CONFIGURATION: int = 1048576¶
AUTO_MODERATION_RULE_CREATE
AUTO_MODERATION_RULE_UPDATE
AUTO_MODERATION_RULE_DELETE
- DIRECT_MESSAGE_REACTIONS: int = 8192¶
MESSAGE_REACTION_ADD
MESSAGE_REACTION_REMOVE
MESSAGE_REACTION_REMOVE_ALL
MESSAGE_REACTION_REMOVE_EMOJI
- GUILDS: int = 1¶
GUILD_CREATE
GUILD_UPDATE
GUILD_DELETE
GUILD_ROLE_CREATE
GUILD_ROLE_UPDATE
GUILD_ROLE_DELETE
CHANNEL_CREATE
CHANNEL_UPDATE
CHANNEL_DELETE
CHANNEL_PINS_UPDATE
THREAD_CREATE
THREAD_UPDATE
THREAD_DELETE
THREAD_LIST_SYNC
THREAD_MEMBER_UPDATE
THREAD_MEMBERS_UPDATE
STAGE_INSTANCE_CREATE
STAGE_INSTANCE_UPDATE
STAGE_INSTANCE_DELETE
VOICE_CHANNEL_STATUS_UPDATE
VOICE_CHANNEL_START_TIME_UPDATE
- GUILD_EXPRESSIONS: int = 8¶
GUILD_EMOJIS_UPDATE
GUILD_STICKERS_UPDATE
GUILD_SOUNDBOARD_SOUND_CREATE
GUILD_SOUNDBOARD_SOUND_UPDATE
GUILD_SOUNDBOARD_SOUND_DELETE
GUILD_SOUNDBOARD_SOUNDS_UPDATE
- GUILD_INTEGRATIONS: int = 16¶
GUILD_INTEGRATIONS_UPDATE
INTEGRATION_CREATE
INTEGRATION_UPDATE
INTEGRATION_DELETE
- GUILD_MEMBERS: int = 2¶
GUILD_MEMBER_ADD
GUILD_MEMBER_UPDATE
GUILD_MEMBER_REMOVE
THREAD_MEMBERS_UPDATE
- GUILD_MESSAGE_REACTIONS: int = 1024¶
MESSAGE_REACTION_ADD
MESSAGE_REACTION_REMOVE
MESSAGE_REACTION_REMOVE_ALL
MESSAGE_REACTION_REMOVE_EMOJI
- GUILD_SCHEDULED_EVENTS: int = 65536¶
GUILD_SCHEDULED_EVENT_CREATE
GUILD_SCHEDULED_EVENT_UPDATE
GUILD_SCHEDULED_EVENT_DELETE
GUILD_SCHEDULED_EVENT_USER_ADD
GUILD_SCHEDULED_EVENT_USER_REMOVE
- class discord.enums.GuildFeature[source]¶
-
- APPLICATION_COMMAND_PERMISSIONS_V2: str = 'APPLICATION_COMMAND_PERMISSIONS_V2'¶
Guild is using the old permissions configuration behavior
- COMMUNITY: str = 'COMMUNITY'¶
Guild can enable welcome screen, Membership Screening, stage channels and discovery, and receives community updates
- CREATOR_MONETIZABLE_PROVISIONAL: str = 'CREATOR_MONETIZABLE_PROVISIONAL'¶
Guild has enabled monetization
- DEVELOPER_SUPPORT_SERVER: str = 'DEVELOPER_SUPPORT_SERVER'¶
Guild has been set as a support server on the App Directory
- INVITES_DISABLED: str = 'INVITES_DISABLED'¶
Guild has paused invites, preventing new users from joining
- MEMBER_VERIFICATION_GATE_ENABLED: str = 'MEMBER_VERIFICATION_GATE_ENABLED'¶
Guild has enabled Membership Screening
- PREVIEW_ENABLED: str = 'PREVIEW_ENABLED'¶
Guild can be previewed before joining via Membership Screening or the directory
- RAID_ALERTS_DISABLED: str = 'RAID_ALERTS_DISABLED'¶
Guild has disabled alerts for join raids in the configured safety alerts channel
- ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE: str = 'ROLE_SUBSCRIPTIONS_AVAILABLE_FOR_PURCHASE'¶
Guild has role subscriptions that can be purchased
- ROLE_SUBSCRIPTIONS_ENABLED: str = 'ROLE_SUBSCRIPTIONS_ENABLED'¶
Guild has enabled role subscriptions
- class discord.flags.GuildMemberFlag[source]¶
- AUTOMOD_QUARANTINED_GUILD_TAG: int = 1024¶
Member’s guild tag is blocked by AutoMod.
Editable:
False
- AUTOMOD_QUARANTINED_USERNAME: str = 128¶
Member’s username, display name, or nickname is blocked by AutoMod.
Editable:
False
- BYPASSES_VERIFICATION: int = 4¶
Member is exempt from guild verification requirements.
Editable:
TrueHint
Allows a member who does not meet verification requirements to participate in a server.
- COMPLETED_HOME_ACTIONS: int = 64¶
Member has completed Server Guide new member actions.
Editable:
False
- DM_SETTINGS_UPSELL_ACKNOWLEDGED: int = 512¶
Member has dismissed the DM settings upsell.
Editable:
False
- class discord.enums.OpCode[source]¶
-
- HEARTBEAT_ACK: int = 11¶
Sent in response to receiving a heartbeat to acknowledge that it has been received.
- INVALID_SESSION: int = 9¶
The session has been invalidated. You should reconnect and identify/resume accordingly.
- class discord.flags.PermissionFlag(*values)[source]¶
Represents a set of permission flags
- ADD_REACTIONS: int = 64¶
Allows for adding new reactions to messages. This permission does not apply to reacting with an existing reaction on a message.
- ADMINISTRATOR: int = 8¶
Allows all permission and bypasses channel permission overwrites.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- BAN_MEMBERS: int = 4¶
Allows banning members.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- CREATE_EVENTS: int = 17592186044416¶
Allows for creating scheduled events, and editing and deleting those created by the current user
- CREATE_GUILD_EXPRESSIONS: int = 8796093022208¶
Allows for creating emojis, stickers, and soundboard sounds, and editing and deleting those created by the current users
- KICK_MEMBERS: int = 2¶
Allows kicking members.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- MANAGE_CHANNELS: int = 16¶
Allows management and editing of channels.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- MANAGE_EVENTS: int = 8589934592¶
Allows for editing and deleting scheduled events created by all users
- MANAGE_GUILD: int = 32¶
Allows management and editing of the guild.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- MANAGE_GUILD_EXPRESSIONS: int = 1073741824¶
Allows for editing and deleting emojis, stickers, and soundboard sounds created by all users.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- MANAGE_MESSAGES: int = 8192¶
Allows for deletion of other users messages.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- MANAGE_ROLES: int = 268435456¶
Allows management and editing of roles.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- MANAGE_THREADS: int = 17179869184¶
Allows for deleting and archiving threads, and viewing all private threads.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- MANAGE_WEBHOOKS: int = 536870912¶
Allows management and editing of webhooks.
Attention
This permission requires the owner account to use two-factor authentication when used on a guild that has server-wide 2FA enabled.
- MENTION_EVERYONE: int = 131072¶
Allows for using the
@everyonetag to notify all users in a channel, and the@heretag to notify all online users in a channel
- MODERATE_MEMBERS: int = 1099511627776¶
Allows for timing out users to prevent them from sending or reacting to messages in chat and threads, and speaking in voice and stage channels
- SEND_MESSAGES: int = 2048¶
Allows for sending messages in a channel and creating threads in a forum (does not allow sending messages in threads)
- USE_APPLICATION_COMMANDS: int = 2147483648¶
Allows members to use application commands, including slash commands and context menu commands
- USE_EMBEDDED_ACTIVITIES: int = 549755813888¶
Allows for using Activities (applications with the
EMBEDDEDflag)
- USE_EXTERNAL_APPS: int = 1125899906842624¶
Allows user-installed apps to send public responses. When disabled, users will still be allowed to use their apps but the responses will be ephemeral. This only applies to apps not also installed to the server
- USE_EXTERNAL_SOUNDS: int = 35184372088832¶
Allows the usage of custom soundboard sounds from other servers
- VIEW_CHANNEL: int = 1024¶
Allows guild members to view a channel, which includes reading messages in text channels and joining voice channels
- class discord.flags.SystemChannelFlag[source]¶
- class discord.enums.TeamMemberRole[source]¶
- ADMIN: str = 'admin'¶
Admins have similar access as owners, except they cannot take destructive actions on the team or team-owned apps.
- DEVELOPER: str = '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
DEVELOPERrole cannot manage the team or its members, or take destructive actions on team-owned apps.
- class discord.flags.UserFlag[source]¶
- class discord.enums.WebhookEventType[source]¶
- APPLICATION_AUTHORIZED: str = 'APPLICATION_AUTHORIZED'¶
Sent when an app was authorized by a user to a server or their account
- APPLICATION_DEAUTHORIZED: str = 'APPLICATION_DEAUTHORIZED'¶
Sent when an app was deauthorized by a user
- GAME_DIRECT_MESSAGE_CREATE: str = 'GAME_DIRECT_MESSAGE_CREATE'¶
Sent when a direct message is created during an active Social SDK session
- GAME_DIRECT_MESSAGE_DELETE: str = 'GAME_DIRECT_MESSAGE_DELETE'¶
Sent when a direct message is deleted during an active Social SDK session