Skip to main content

Overview

Pycord uses custom enum classes throughout the library. These enums provide type-safe values for various Discord concepts.

Status Enums

Represents a user’s online status.Values:
  • online - Online status (“online”)
  • offline - Offline status (“offline”)
  • idle - Idle status (“idle”)
  • dnd - Do not disturb status (“dnd”)
  • do_not_disturb - Alias for dnd (“dnd”)
  • invisible - Invisible status (“invisible”)
  • streaming - Streaming status (“streaming”)
await client.change_presence(status=discord.Status.dnd)
Represents the type of activity.Values:
  • unknown = -1
  • playing = 0
  • streaming = 1
  • listening = 2
  • watching = 3
  • custom = 4
  • competing = 5
activity = discord.Activity(type=discord.ActivityType.listening, name="Spotify")

Channel Enums

Represents the type of channel.Values:
  • text = 0 - Text channel
  • private = 1 - Private DM channel
  • voice = 2 - Voice channel
  • group = 3 - Group DM channel
  • category = 4 - Category channel
  • news = 5 - News/announcement channel
  • news_thread = 10 - News thread
  • public_thread = 11 - Public thread
  • private_thread = 12 - Private thread
  • stage_voice = 13 - Stage voice channel
  • directory = 14 - Directory channel
  • forum = 15 - Forum channel
  • media = 16 - Media channel
if channel.type == discord.ChannelType.voice:
    print("This is a voice channel")
Represents the video quality mode for voice channels.Values:
  • auto = 1 - Discord chooses quality for optimal performance
  • full = 2 - 720p video quality
await voice_channel.edit(video_quality_mode=discord.VideoQualityMode.full)

Message Enums

Represents the type of message.Values:
  • default = 0 - Default message
  • recipient_add = 1
  • recipient_remove = 2
  • call = 3
  • channel_name_change = 4
  • channel_icon_change = 5
  • pins_add = 6
  • new_member = 7
  • premium_guild_subscription = 8
  • premium_guild_tier_1 = 9
  • premium_guild_tier_2 = 10
  • premium_guild_tier_3 = 11
  • channel_follow_add = 12
  • guild_stream = 13
  • thread_created = 18
  • reply = 19 - Reply to another message
  • application_command = 20 - Slash command response
  • thread_starter_message = 21
  • context_menu_command = 23
  • auto_moderation_action = 24
  • role_subscription_purchase = 25
  • poll_result = 46
if message.type == discord.MessageType.reply:
    print(f"Replying to: {message.reference.resolved}")

Voice Enums

Represents the speaking state in voice.Values:
  • none = 0 - Not speaking
  • voice = 1 - Speaking with voice
  • soundshare = 2 - Soundshare (playing audio)
  • priority = 4 - Priority speaking
# These can be combined using bitwise OR
speaking = discord.SpeakingState.voice | discord.SpeakingState.soundshare
Represents available voice regions.Values:
  • us_west = “us-west”
  • us_east = “us-east”
  • us_south = “us-south”
  • us_central = “us-central”
  • eu_west = “eu-west”
  • eu_central = “eu-central”
  • singapore = “singapore”
  • london = “london”
  • sydney = “sydney”
  • amsterdam = “amsterdam”
  • frankfurt = “frankfurt”
  • brazil = “brazil”
  • hongkong = “hongkong”
  • russia = “russia”
  • japan = “japan”
  • southafrica = “southafrica”
  • south_korea = “south-korea”
  • india = “india”
  • europe = “europe”
  • dubai = “dubai”
  • And various VIP regions…
regions = await guild.fetch_voice_regions()
for region in regions:
    print(region.id)

Guild Enums

Represents the verification level of a guild.Values:
  • none = 0 - No verification required
  • low = 1 - Must have verified email
  • medium = 2 - Must be registered for 5+ minutes
  • high = 3 - Must be a member for 10+ minutes
  • highest = 4 - Must have verified phone number
This enum is comparable, allowing you to use comparison operators.
if guild.verification_level >= discord.VerificationLevel.high:
    print("High verification required")
Represents the content filter level for explicit content.Values:
  • disabled = 0 - No filtering
  • no_role = 1 - Filter members without roles
  • all_members = 2 - Filter all members
This enum is comparable.
await guild.edit(explicit_content_filter=discord.ContentFilter.all_members)
Represents the default notification level for a guild.Values:
  • all_messages = 0 - Notify for all messages
  • only_mentions = 1 - Notify only for mentions
This enum is comparable.
await guild.edit(default_notifications=discord.NotificationLevel.only_mentions)
Represents the NSFW level of a guild.Values:
  • default = 0
  • explicit = 1
  • safe = 2
  • age_restricted = 3
This enum is comparable.

Component Enums

Represents the type of component.Values:
  • action_row = 1 - Action row container
  • button = 2 - Button component
  • string_select = 3 - String select menu
  • select = 3 - Alias for string_select (deprecated)
  • input_text = 4 - Text input
  • user_select = 5 - User select menu
  • role_select = 6 - Role select menu
  • mentionable_select = 7 - Mentionable select menu
  • channel_select = 8 - Channel select menu
if component.type == discord.ComponentType.button:
    print("This is a button")
Represents the style of a button.Values:
  • primary = 1 (alias: blurple)
  • secondary = 2 (aliases: grey, gray)
  • success = 3 (alias: green)
  • danger = 4 (alias: red)
  • link = 5 (alias: url)
  • premium = 6
button = discord.ui.Button(style=discord.ButtonStyle.success, label="Confirm")
Represents the style of text input in modals.Values:
  • short = 1 (aliases: singleline)
  • paragraph = 2 (aliases: multiline, long)
text_input = discord.ui.InputText(
    style=discord.InputTextStyle.paragraph,
    label="Feedback"
)

Interaction Enums

Represents the type of interaction.Values:
  • ping = 1
  • application_command = 2
  • component = 3
  • auto_complete = 4
  • modal_submit = 5
if interaction.type == discord.InteractionType.application_command:
    print("Slash command used")
Represents the type of interaction response.Values:
  • pong = 1
  • channel_message = 4
  • deferred_channel_message = 5
  • deferred_message_update = 6 - For components
  • message_update = 7 - For components
  • auto_complete_result = 8 - For autocomplete
  • modal = 9 - For modal dialogs
  • premium_required = 10
Represents where an interaction can be used.Values:
  • guild = 0 - In guild channels
  • bot_dm = 1 - In bot DMs
  • private_channel = 2 - In private channels
@bot.slash_command(contexts=[discord.InteractionContextType.guild])
async def guild_only(ctx):
    await ctx.respond("This only works in guilds!")

Audit Log Enums

Represents an action in the audit log.Common Values:
  • guild_update = 1
  • channel_create = 10
  • channel_update = 11
  • channel_delete = 12
  • kick = 20
  • ban = 22
  • unban = 23
  • member_update = 24
  • member_role_update = 25
  • role_create = 30
  • role_update = 31
  • role_delete = 32
  • invite_create = 40
  • message_delete = 72
  • message_bulk_delete = 73
  • And many more…
async for entry in guild.audit_logs(action=discord.AuditLogAction.ban):
    print(f"{entry.user} banned {entry.target}")
Represents a category of audit log action.Values:
  • create = 1
  • delete = 2
  • update = 3
if entry.action.category == discord.AuditLogActionCategory.delete:
    print("Something was deleted")

User & Permissions Enums

Represents Discord user flags/badges.Values:
  • staff = 1
  • partner = 2
  • hypesquad = 4
  • bug_hunter = 8
  • hypesquad_bravery = 64
  • hypesquad_brilliance = 128
  • hypesquad_balance = 256
  • early_supporter = 512
  • verified_bot = 65536
  • verified_bot_developer = 131072
  • discord_certified_moderator = 262144
  • active_developer = 4194304
if user.public_flags.verified_bot_developer:
    print("Early verified bot developer!")

Other Enums

Represents the type of slash command option.Values:
  • sub_command = 1
  • sub_command_group = 2
  • string = 3
  • integer = 4
  • boolean = 5
  • user = 6
  • channel = 7
  • role = 8
  • mentionable = 9
  • number = 10
  • attachment = 11
Represents the type of webhook.Values:
  • incoming = 1
  • channel_follower = 2
  • application = 3
if webhook.type == discord.WebhookType.incoming:
    await webhook.send("Hello!")
Represents the type of sticker.Values:
  • standard = 1 - Official Discord sticker
  • guild = 2 - Custom guild sticker
Represents the format of a sticker.Values:
  • png = 1
  • apng = 2 - Animated PNG
  • lottie = 3 - Lottie animation
  • gif = 4
Each has a file_extension property that returns the appropriate extension.
Represents the target of an invite.Values:
  • unknown = 0
  • stream = 1
  • embedded_application = 2
Represents how long until a thread is automatically archived.Values:
  • one_hour = 60
  • one_day = 1440
  • three_days = 4320
  • one_week = 10080
await channel.create_thread(
    name="Discussion",
    auto_archive_duration=discord.ThreadArchiveDuration.one_day
)
Represents the application’s integration type.Values:
  • guild_install = 0 - Installed to guild
  • user_install = 1 - User-installed app
Represents the poll’s layout type.Values:
  • default = 1

Build docs developers (and LLMs) love