Enumerations

The API provides some enumerations for certain types of strings to avoid the API from being strongly typed in case the strings change in the future.

All enumerations are subclasses of an internal class which mimics the behaviour of enum.Enum.

class discord.SlashCommandOptionType[исходный код]

Specifies the input type of an option.

Добавлено в версии 2.0.

sub_command

A slash subcommand.

sub_command_group

A slash command group.

string

A string.

integer

An integer where \(-2^{53} < x < 2^{53}\).

Примечание

IDs, such as 881224361015672863, are often too big for this input type.

boolean

A boolean.

user

A user from the current channel. This will be converted to an instance of User in private channels, else Member

channel

A channel from the current guild.

role

A role from the current guild.

mentionable

A mentionable (user or role).

number

A floating-point number where \(-2^{53} < x < 2^{53}\).

Примечание

IDs, such as 881224361015672863, are often too big for this input type.

attachment

An attachment.

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.

stage_voice

A guild stage voice channel.

Добавлено в версии 1.7.

news_thread

A news thread.

Добавлено в версии 2.0.

public_thread

A public thread.

Добавлено в версии 2.0.

private_thread

A private thread.

Добавлено в версии 2.0.

directory

A guild directory entry, used in hub guilds, currently in experiment.

Добавлено в версии 2.0.

forum

User can only write in threads, similar functionality to a forum.

Добавлено в версии 2.0.

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 user is added to a group private message or a thread.

recipient_remove

The system message when a user is removed from a group private message or a thread.

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.

Добавлено в версии 1.3.

guild_stream

The system message denoting that a member is streaming in the guild.

Добавлено в версии 1.7.

guild_discovery_disqualified

The system message denoting that the guild is no longer eligible for Server Discovery.

Добавлено в версии 1.7.

guild_discovery_requalified

The system message denoting that the guild has become eligible again for Server Discovery.

Добавлено в версии 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.

Добавлено в версии 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.

Добавлено в версии 1.7.

thread_created

The system message denoting that a thread has been created. This is only sent if the thread has been created from an older message. The period of time required for a message to be considered old cannot be relied upon and is up to Discord.

Добавлено в версии 2.0.

reply

The system message denoting that the author is replying to a message.

Добавлено в версии 2.0.

application_command

The system message denoting that an application (or «slash») command was executed.

Добавлено в версии 2.0.

guild_invite_reminder

The system message sent as a reminder to invite people to the guild.

Добавлено в версии 2.0.

thread_starter_message

The system message denoting the message in the thread that is the one that started the thread’s conversation topic.

Добавлено в версии 2.0.

context_menu_command

The system message denoting that an context menu command was executed.

Добавлено в версии 2.0.

auto_moderation_action

The system message denoting an action by automod.

Добавлено в версии 2.3.

role_subscription_purchase

The system message denoting a role-subscription purchase.

Добавлено в версии 2.4.

interaction_premium_upsell

The system message denoting an interaction premium upsell.

Добавлено в версии 2.4.

stage_start

The system message denoting that a stage event has started.

Добавлено в версии 2.4.

stage_end

The system message denoting that a stage event has ended.

Добавлено в версии 2.4.

stage_speaker

The system message denoting that a stage event has a new speaker.

Добавлено в версии 2.4.

stage_raise_hand

The system message denoting that someone in a stage event is raising their hand.

Добавлено в версии 2.4.

stage_topic

The system message denoting that a stage event has a new topic.

Добавлено в версии 2.4.

guild_application_premium_subscription

The system message denoting that a member has subscribed to a guild application.

Добавлено в версии 2.4.

class discord.UserFlags[исходный код]

Represents Discord User flags.

staff

The user is a Discord Employee.

partner

The user is a Discord Partner.

hypesquad

The user is a HypeSquad Events member.

bug_hunter

The user is a Bug Hunter.

mfa_sms

The user has SMS recovery for Multi Factor Authentication enabled.

premium_promo_dismissed

The user has dismissed the Discord Nitro promotion.

hypesquad_bravery

The user is a HypeSquad Bravery member.

hypesquad_brilliance

The user is a HypeSquad Brilliance member.

hypesquad_balance

The user is a HypeSquad Balance member.

early_supporter

The user is an Early Supporter.

team_user

The user is a Team User.

partner_or_verification_application

Relates to partner/verification applications.

system

The user is a system user (i.e. represents Discord officially).

has_unread_urgent_messages

The user has an unread system message.

bug_hunter_level_2

The user is a Bug Hunter Level 2.

underage_deleted

The user was deleted for being underage.

verified_bot

The user is a Verified Bot.

verified_bot_developer

The user is an Early Verified Bot Developer.

discord_certified_moderator

The user is a Moderator Programs Alumni.

bot_http_interactions

The bot has set an interactions endpoint url.

spammer

The user is disabled for being a spammer.

active_developer

The user is an Active Developer.

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.

Добавлено в версии 1.5.

class discord.InteractionType[исходный код]

Specifies the type of Interaction.

Добавлено в версии 2.0.

ping

Represents Discord pinging to see if the interaction response server is alive.

application_command

Represents a slash command interaction.

component

Represents a component-based interaction, i.e. using the Discord Bot UI Kit.

auto_complete

Represents a autocomplete interaction for slash commands.

modal_submit

Represents a modal-based interaction.

class discord.InteractionResponseType[исходный код]

Specifies the response type for the interaction.

Добавлено в версии 2.0.

pong

Pongs the interaction when given a ping.

See also InteractionResponse.pong()

channel_message

Respond to the interaction with a message.

See also InteractionResponse.send_message()

deferred_channel_message

Responds to the interaction with a message at a later time.

See also InteractionResponse.defer()

deferred_message_update

Acknowledges the component interaction with a promise that the message will update later (though there is no need to actually update the message).

See also InteractionResponse.defer()

message_update

Responds to the interaction by editing the message.

See also InteractionResponse.edit_message()

auto_complete_result

Responds to the interaction by sending the autocomplete choices.

See also InteractionResponse.send_autocomplete_result()

modal

Responds to the interaction by sending a modal dialog.

See also InteractionResponse.send_modal()

class discord.ComponentType[исходный код]

Represents the component type of a component.

Добавлено в версии 2.0.

action_row

Represents the group component which holds different components in a row.

button

Represents a button component.

select

Represents a string select component.

Устарело, начиная с версии 2.3: Use ComponentType.string_select instead.

string_select

Represents a string select component.

input_text

Represents an input_text component.

user_select

Represents a user select component.

role_select

Represents a role select component.

mentionable_select

Represents a mentionable select component.

channel_select

Represents a channel select component.

section

Represents a section component.

text_display

Represents a text display component.

thumbnail

Represents a thumbnail component.

Represents a media gallery component.

file

Represents a file component.

separator

Represents a separator component.

content_inventory_entry

Represents a content inventory entry component.

container

Represents a container component.

label

Represents a label component.

file_upload

Represents a file upload component.

radio_group

Represents a radio group component.

checkbox_group

Represents a checkbox group component.

checkbox

Represents a checkbox component.

class discord.ButtonStyle[исходный код]

Represents the style of the button component.

Добавлено в версии 2.0.

primary

Represents a blurple button for the primary action.

secondary

Represents a grey button for the secondary action.

success

Represents a green button for a successful action.

danger

Represents a red button for a dangerous action.

Represents a link button.

premium

Represents a premium button.

blurple

An alias for primary.

grey

An alias for secondary.

gray

An alias for secondary.

green

An alias for success.

red

An alias for danger.

url

An alias for link.

class discord.InputTextStyle[исходный код]

Represents the style of the input text component.

Добавлено в версии 2.0.

short

Represents a single-line input text field.

long

Represents a multi-line input text field.

singleline

An alias for short.

multiline

An alias for long.

paragraph

An alias for long.

class discord.VoiceRegion[исходный код]

Specifies the region a voice server belongs to.

amsterdam

The Amsterdam region.

brazil

The Brazil region.

dubai

The Dubai region.

Добавлено в версии 1.3.

eu_central

The EU Central region.

eu_west

The EU West region.

europe

The Europe region.

Добавлено в версии 1.3.

frankfurt

The Frankfurt region.

hongkong

The Hong Kong region.

india

The India region.

Добавлено в версии 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.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.

Добавлено в версии 2.0.

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.

highest

Member must have a verified phone on their Discord account.

class discord.NotificationLevel[исходный код]

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

Добавлено в версии 2.0.

x == y

Checks if two notification levels are equal.

x != y

Checks if two notification levels are not equal.

x > y

Checks if a notification level is higher than another.

x < y

Checks if a notification level is lower than another.

x >= y

Checks if a notification level is higher or equal to another.

x <= y

Checks if a notification level is lower or equal to another.

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.

Добавлено в версии 2.0.

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.

streaming

The member is streaming.

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, banner, or discovery splash

  • 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 undone)

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

Добавлено в версии 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.

Добавлено в версии 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.

Добавлено в версии 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 GuildEmoji 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 GuildEmoji 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.

Добавлено в версии 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.

Добавлено в версии 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.

Добавлено в версии 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.

Добавлено в версии 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.

Добавлено в версии 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.

Добавлено в версии 1.3.

stage_instance_create

A stage instance was started.

When this is the action, the type of target is the StageInstance or Object with the ID of the stage instance which was created.

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

stage_instance_update

A stage instance was updated.

When this is the action, the type of target is the StageInstance or Object with the ID of the stage instance which was updated.

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

stage_instance_delete

A stage instance was ended.

Добавлено в версии 2.0.

sticker_create

A sticker was created.

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

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

sticker_update

A sticker was updated.

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

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

sticker_delete

A sticker was deleted.

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

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

scheduled_event_create

A scheduled event was created.

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

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

scheduled_event_update

A scheduled event was updated.

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

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

scheduled_event_delete

A scheduled event was deleted.

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

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

thread_create

A thread was created.

When this is the action, the type of target is the Thread or Object with the ID of the thread which was created.

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

thread_update

A thread was updated.

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

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

thread_delete

A thread was deleted.

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

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

application_command_permission_update

An application command’s permissions were updated.

When this is the action, the type of target is an Object with the ID of the command that had it’s permissions edited.

Possible attributes for AuditLogDiff:

Добавлено в версии 2.0.

auto_moderation_rule_create

A guild auto moderation rule was created.

Possible attributes for AuditLogDiff:

  • name

  • enabled

  • trigger_type

  • event_type

  • trigger_metadata

  • actions

  • exempt_roles

  • exempt_channels

Добавлено в версии 2.5.

auto_moderation_rule_update

A guild auto moderation rule was updated.

Possible attributes for AuditLogDiff:

  • name

  • enabled

  • trigger_type

  • trigger_metadata

  • actions

  • exempt_roles

  • exempt_channels

Добавлено в версии 2.5.

auto_moderation_rule_delete

A guild auto moderation rule was deleted.

Possible attributes for AuditLogDiff:

  • name

  • enabled

  • trigger_type

  • event_type

  • trigger_metadata

  • actions

  • exempt_roles

  • exempt_channels

Добавлено в версии 2.5.

auto_moderation_block_message

A message was blocked by auto moderation.

Добавлено в версии 2.5.

auto_moderation_flag_to_channel

A message was flagged by auto moderation.

Добавлено в версии 2.5.

auto_moderation_user_communication_disabled

A member was timed out by auto moderation.

Добавлено в версии 2.5.

creator_monetization_request_created

A creator monetization request was created.

Добавлено в версии 2.5.

creator_monetization_terms_accepted

The creator monetization terms were accepted.

Добавлено в версии 2.5.

voice_channel_status_update

A voice channel status was updated.

When this is the action, the type of target is the VoiceChannel or Object with the ID of the voice channel which was updated.

Possible attributes for AuditLogDiff:

Добавлено в версии 2.5.

voice_channel_status_delete

A voice channel status was deleted.

When this is the action, the type of target is the VoiceChannel or Object with the ID of the voice channel which was updated.

Possible attributes for AuditLogDiff:

Добавлено в версии 2.5.

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.TeamMembershipState[исходный код]

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

Добавлено в версии 1.3.

invited

Represents an invited member.

accepted

Represents a member currently in the team.

class discord.WebhookType[исходный код]

Represents the type of webhook that can be received.

Добавлено в версии 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.

application

Represents a webhook that is used for interactions or applications.

Добавлено в версии 2.0.

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.

Добавлено в версии 1.4.

remove_role

This will remove the StreamIntegration.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

class discord.StickerType[исходный код]

Represents the type of sticker.

Добавлено в версии 2.0.

standard

Represents a standard sticker that all Nitro users can use.

guild

Represents a custom sticker created in a guild.

class discord.StickerFormatType[исходный код]

Represents the type of sticker images.

Добавлено в версии 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.

Добавлено в версии 2.4.

class discord.InviteTarget[исходный код]

Represents the invite type for voice channel invites.

Добавлено в версии 2.0.

unknown

The invite doesn’t target anyone or anything.

stream

A stream invite that targets a user.

embedded_application

A invite that targets an embedded application.

Note that your bot won’t be verified if you provide users access to this

class discord.InviteTargetUsersJobStatusCode[исходный код]

Represents the status code for an invite target users processing job.

Добавлено в версии 2.8.

unspecified

The job status is unspecified.

processing

The job is currently processing.

completed

The job has completed successfully.

failed

The job has failed.

class discord.VideoQualityMode[исходный код]

Represents the camera video quality mode for voice channel participants.

Добавлено в версии 2.0.

auto

Represents auto camera video quality.

full

Represents full camera video quality.

class discord.StagePrivacyLevel[исходный код]

Represents a stage instance’s privacy level. Stage event privacy levels can only have 1 possible value at the moment so this shouldn’t really be used.

Добавлено в версии 2.0.

closed

The stage instance can only be joined by members of the guild.

guild_only

Alias for closed

class discord.NSFWLevel[исходный код]

Represents the NSFW level of a guild.

Добавлено в версии 2.0.

x == y

Checks if two NSFW levels are equal.

x != y

Checks if two NSFW levels are not equal.

x > y

Checks if a NSFW level is higher than another.

x < y

Checks if a NSFW level is lower than another.

x >= y

Checks if a NSFW level is higher or equal to another.

x <= y

Checks if a NSFW level is lower or equal to another.

default

The guild has not been categorised yet.

explicit

The guild contains NSFW content.

safe

The guild does not contain any NSFW content.

age_restricted

The guild may contain NSFW content.

class discord.EmbeddedActivity[исходный код]

Represents an embedded activity application.

Some might be boost-only or gated.

Предупреждение

Discord said that they won’t verify bots who gives access to embedded activities.

Read more here: https://discord.com/channels/613425648685547541/697236247739105340/901153332075315321.

Добавлено в версии 2.0.

ask_away

Represents the embedded application Ask Away.

Добавлено в версии 2.4.

awkword

Represents the embedded application Awkword.

Предупреждение

This activity has been removed.

awkword_dev

Development version of awkword.

Предупреждение

This activity has been removed.

bash_out

Represents the embedded application Bash Out.

Добавлено в версии 2.4.

betrayal

Represents the embedded application Betrayal.io.

blazing_8s

Represents the embedded application Blazing 8s.

Добавлено в версии 2.4.

blazing_8s_dev

Development version of blazing_8s.

Добавлено в версии 2.4.

blazing_8s_qa

QA version of blazing_8s.

Добавлено в версии 2.4.

blazing_8s_staging

Staging version of blazing_8s.

Добавлено в версии 2.4.

bobble_league

Represents the embedded application Bobble League.

Добавлено в версии 2.4.

checkers_in_the_park

Represents the embedded application Checkers in the Park.

checkers_in_the_park_dev

Development version of checkers_in_the_park.

checkers_in_the_park_qa

QA version of checkers_in_the_park.

checkers_in_the_park_staging

Staging version of checkers_in_the_park.

chess_in_the_park

Represents the embedded application Chess in the Park.

chess_in_the_park_dev

Development version of chess_in_the_park.

chess_in_the_park_qa

QA version of chess_in_the_park.

chess_in_the_park_staging

Staging version of chess_in_the_park.

decoders_dev

Represents the embedded application Decoders Development.

Предупреждение

This activity has been removed.

doodle_crew

Represents the embedded application Doodle Crew.

Предупреждение

This activity has been removed.

doodle_crew_dev

Development version of doodle_crew.

Предупреждение

This activity has been removed.

fishington

Represents the embedded application Fishington.io.

gartic_phone

Represents the embedded application Gartic Phone.

Добавлено в версии 2.5.

jamspace

Represents the embedded application Jamspace.

Добавлено в версии 2.5.

know_what_i_meme

Represents the embedded application Know What I Meme.

Добавлено в версии 2.4.

land

Represents the embedded application Land.io.

Добавлено в версии 2.4.

letter_league

Represents the embedded application Letter League.

letter_league_dev

Development version of letter_league.

Добавлено в версии 2.4.

poker_night

Represents the embedded application Poker Night.

poker_night_dev

Development version of poker_night.

Добавлено в версии 2.4.

poker_night_qa

QA version of poker_night.

poker_night_staging

Staging version of poker_night.

putt_party

Represents the embedded application Putt Party.

Добавлено в версии 2.4.

putt_party_dev

Development version of putt_party.

Добавлено в версии 2.4.

putt_party_qa

QA version of putt_party.

Добавлено в версии 2.4.

putt_party_staging

Staging version of putt_party.

Добавлено в версии 2.4.

putts

Represents the embedded application Putts.

Предупреждение

This activity has been removed.

sketch_heads

Represents the embedded application Sketch Heads.

Добавлено в версии 2.4.

sketch_heads_dev

Development version of sketch_heads.

Добавлено в версии 2.4.

sketchy_artist

Represents the embedded application Sketchy Artist.

Предупреждение

This activity has been removed.

sketchy_artist_dev

Development version of sketchy_artist.

Предупреждение

This activity has been removed.

spell_cast

Represents the embedded application Spell Cast.

spell_cast_staging

Staging version of spell_cast.

Добавлено в версии 2.4.

watch_together

Same as youtube_together with remote feature which allows guild admins to limit the playlist access.

watch_together_dev

Development version of watch_together.

word_snacks

Represents the embedded application word snacks.

word_snacks_dev

Development version of word_snacks.

youtube_together

Represents the embedded application Youtube Together.

class discord.ScheduledEventStatus[исходный код]

Represents the status of a scheduled event.

Добавлено в версии 2.0.

scheduled

The scheduled event hasn’t started or been canceled yet.

active

The scheduled event is in progress.

completed

The scheduled event is over.

canceled

The scheduled event has been canceled before it can start.

cancelled

Alias to canceled.

class discord.ScheduledEventLocationType[исходный код]

Represents a scheduled event location type (otherwise known as the entity type on the API).

Добавлено в версии 2.0.

stage_instance

Represents a scheduled event that is happening in a StageChannel.

voice

Represents a scheduled event that is happening in a VoiceChannel.

external

Represents a generic location as a str.

class discord.ScheduledEventPrivacyLevel[исходный код]

Represents the privacy level of a scheduled event. Scheduled event privacy levels can only have 1 possible value at the moment so this shouldn’t really be used.

guild_only

Represents a scheduled event that is only available to members inside the guild.

class discord.ApplicationRoleConnectionMetadataType[исходный код]

Represents an application role connection metadata type.

Each metadata type offers a comparison operation that allows guilds to configure role requirements based on metadata values stored by the bot. Bots specify a metadata value for each user and guilds specify the required guild's configured value within the guild role settings.

Добавлено в версии 2.4.

integer_less_than_or_equal

The metadata value (integer) is less than or equal to the guild’s configured value (integer).

integer_greater_than_or_equal

The metadata value (integer) is greater than or equal to the guild’s configured value (integer).

integer_equal

The metadata value (integer) is equal to the guild’s configured value (integer).

integer_not_equal

The metadata value (integer) is not equal to the guild’s configured value (integer).

datetime_less_than_or_equal

The metadata value (datetime) is less than or equal to the guild’s configured value (integer; the number of days before the current date).

datetime_greater_than_or_equal

The metadata value (datetime) is greater than or equal to the guild’s configured value (integer; the number of days before the current date).

boolean_equal

The metadata value (integer) is equal to the guild’s configured value (integer; 1).

boolean_not_equal

The metadata value (integer) is not equal to the guild’s configured value (integer; 1).

class discord.AutoModTriggerType[исходный код]

Represents an AutoMod trigger type.

Добавлено в версии 2.0.

keyword

Represents a keyword rule trigger, which are customizable by a guild.

Possible attributes for AutoModTriggerMetadata:

keyword_preset

Represents a preset keyword rule trigger.

Possible attributes for AutoModTriggerMetadata:

spam

Represents the spam rule trigger.

There are no possible attributes for AutoModTriggerMetadata.

mention_spam

Represents a mention spam keyword rule trigger.

Possible attributes for AutoModTriggerMetadata:

Добавлено в версии 2.4.

Represents a harmful link rule trigger.

Устарело, начиная с версии 2.4: Removed by Discord and merged into spam.

class discord.AutoModEventType[исходный код]

Represents an AutoMod event type.

Добавлено в версии 2.0.

message_send

Represents a message send AutoMod event.

class discord.AutoModActionType[исходный код]

Represents the type of action AutoMod is performing.

Добавлено в версии 2.0.

block_message

Represents a block message action.

send_alert_message

Represents a send alert message action.

timeout

Represents a timeout action.

class discord.AutoModKeywordPresetType[исходный код]

Represents an AutoMod keyword preset type.

Добавлено в версии 2.0.

profanity

Represents the profanity keyword preset rule.

sexual_content

Represents the sexual content keyword preset rule.

slurs

Represents the slurs keyword preset rule.

class discord.PromptType[исходный код]

Represents how each prompt’s options are displayed.

Добавлено в версии 2.5.

multiple_choice

The options will appear in a grid form, showing the name and description.

dropdown

The options will appear in a dropdown (similar to select menus), but without the description displayed. This is enforced if there are more than 12 options in the prompt.

class discord.OnboardingMode[исходный код]

Represents the current mode of the guild’s onboarding flow.

Добавлено в версии 2.5.

default

Only default channels are counted towards the Onboarding requirements.

advanced

Both default channels and questions (OnboardingPrompts) will count towards the Onboarding requirements.

class discord.ReactionType[исходный код]

Represents a Reaction’s type.

Добавлено в версии 2.5.

normal

Represents a normal reaction.

burst

Represents a super reaction.

class discord.SKUType[исходный код]

Represents an SKU’s type.

Добавлено в версии 2.5.

durable

A one-time purchase that is permanent and is not subject to either renewal or consumption, such as lifetime access to an app’s premium features.

consumable

A one-time, non-renewable purchase that provides access, such as a temporary power-up or boost in a game.

subscription

Represents a recurring subscription.

subscription_group

A system-generated group for each subscription SKU created. These types of SKUs are currently unused.

class discord.EntitlementType[исходный код]

Represents an entitlement’s type.

Добавлено в версии 2.5.

purchase

Entitlement was purchased by the user.

premium_subscription

Entitlement is for a Discord Nitro subscription.

developer_gift

Entitlement was gifted by the developer.

test_mode_purchase

Entitlement was purchased by a developer in the application’s test mode.

free_purchase

Entitlement was granted when the SKU was free.

user_gift

Entitlement was gifted by another user.

premium_purchase

Entitlement was claimed by a user for free as a Nitro subscriber.

application_subscription

Entitlement was purchased as an app subscription.

class discord.EntitlementOwnerType[исходный код]

Represents an entitlement’s ownership type.

Добавлено в версии 2.5.

guild

Entitlement is owned by a guild.

user

Entitlement is owned by a user.

class discord.PollLayoutType[исходный код]

Represents a poll’s layout type.

Добавлено в версии 2.6.

default

Represents the default layout.

class discord.IntegrationType[исходный код]

The integration type for an application.

Добавлено в версии 2.6.

guild_install

The integration is added to a guild.

user_install

The integration is added to a user account.

class discord.InteractionContextType[исходный код]

The context where an interaction occurs.

Добавлено в версии 2.6.

guild

The interaction is in a guild.

bot_dm

The interaction is in the bot’s own DM channel with the user.

private_channel

The interaction is in a private DM or group DM channel.

class discord.VoiceChannelEffectAnimationType[исходный код]

Represents the type of animation for a voice channel effect.

Добавлено в версии 2.7.

premium

The animation is a premium effect.

basic

The animation is a basic effect.

class discord.SubscriptionStatus[исходный код]

Represents a subscription’s status.

Добавлено в версии 2.7.

active

The subscription is active and is scheduled to renew.

ending

The subscription is active but will not renew.

inactive

The subscription is inactive and the subscription owner is not being charged.

class discord.ThreadArchiveDuration[исходный код]

Represents the time before a thread is archived.

Добавлено в версии 2.7.

one_hour

Indicates that the thread will be archived after 1 hour of inactivity.

one_day

Indicates that the thread will be archived after 1 day of inactivity.

three_days

Indicates that the thread will be archived after 3 days of inactivity.

one_week

Indicates that the thread will be archived after 1 week of inactivity.

class discord.SeparatorSpacingSize[исходный код]

Represents the padding size around a separator component.

Добавлено в версии 2.7.

small

The separator uses small padding.

large

The separator uses large padding.

class discord.SortOrder

Used to represent the default sort order for posts in ForumChannel and MediaChannel.

latest_activity

Sort by latest activity.

creation_date

Sort by post creation date.

class discord.SelectDefaultValueType[исходный код]

Represents the default value type of a select menu.

channel

The default value is a channel.

role

The default value is a role.

user

The default value is a user.

class discord.RoleType(*values)[исходный код]

Represents the type of role.

This is NOT provided by Discord but is rather computed from Role.tags.

Добавлено в версии 2.8.

NORMAL

The role is a normal role.

Type:

int

APPLICATION

The role is an application (bot) role.

Type:

int

BOOSTER

The role is a guild’s booster role.

Type:

int

GUILD_PRODUCT

The role is a guild product role.

Примечание

This is not possible to determine at times because role tags seem to be missing altogether, notably when a guild product role is fetched. In such cases Role.type will be RoleType.NORMAL and Role.tags will be None.

Type:

int

PREMIUM_SUBSCRIPTION_BASE

The role is a base subscription role.

Примечание

This is not possible to determine currently, will be INTEGRATION if it’s a base subscription.

Type:

int

PREMIUM_SUBSCRIPTION_TIER

The role is a subscription role.

Type:

int

DRAFT_PREMIUM_SUBSCRIPTION_TIER

The role is a draft subscription role.

Type:

int

INTEGRATION

The role is an integration role, such as Twitch or YouTube, or a base subscription role.

Type:

int

CONNECTION

The role is a guild connections role.

Type:

int

UNKNOWN

The role type is unknown.

Type:

int

class discord.ApplicationEventWebhookStatus[исходный код]

Represents the application event webhook status.

Добавлено в версии 2.8.

disabled

The application webhook is disabled.

enabled

The application webhook is enabled.

disabled_by_discord
The application webhook is disabled by Discord.
class discord.TeamRole[исходный код]
Represents a app team role.

Добавлено в версии 2.8.

owner

Represents the team owner role.

admin

Represents the team admin role.

developer

Represents the team developer role.

read_only

Represents the team read only role.