Discord Objects

class discord.objects.Application[source]
approximate_guild_count: Optional[int]

Approximate count of guilds the app has been added to

approximate_user_authorization_count: Optional[int]

Approximate count of users that have OAuth2 authorization for the app

approximate_user_install_count: Optional[int]

Approximate count of users that have installed the app (authorized with application.commands as a scope)

bot: Optional[User]

Partial user object for the bot user associated with the app

bot_public: bool

When False, only the app owner can add the app to the guilds

bot_require_code_grant: bool

When True, the app’s bot will only join upon completion of the full OAuth2 code grant flow

cover_image: Optional[str]

App’s default rich presence invite cover image hash

custom_install_url: Optional[str]

Default custom authorization URL for the app, if enabled

description: str

Description of the app

event_webhook_status: Optional[ApplicationEventWebhookStatus]

If webhook events are enabled for the app. 1 (default) means disabled, 2 means enabled, 3 means disabled by Discord

event_webhooks_types: Optional[list[WebhookEventType]]

List of WebhookEventTypes the app subscribes to

event_webhooks_url: Optional[Nullable[str]]

Event webhooks URL for the app to receive webhook events

flags: Optional[ApplicationFlag]

App’s public flags

guild: Optional[Guild]

Partial object of the associated guild

guild_id: Optional[Snowflake]

Guild associated with the app. For example, a developer support server.

icon: Nullable[str]

Icon hash of the app

id: Snowflake

ID of the app

install_params: Optional[InstallParams]

Settings for the app’s default in-app authorization link, if enabled

integration_types_config: Optional[dict[ApplicationIntegrationType, ApplicationIntegrationTypeConfiguration]]

Default scopes and permissions for each supported installation context

interactions_endpoint_url: Optional[Nullable[str]]

Interactions endpoint URL for the app

name: str

Name of the app

owner: Optional[User]

Partial user object for the owner of the app

primary_sku_id: Optional[Snowflake]

If this app is a game sold on Discord, this field will be the id of the “Game SKU” that is created, if exists

privacy_policy_url: Optional[str]

URL of the app’s Privacy Policy

redirect_uris: Optional[list[str]]

Array of redirect URIs for the app

role_connections_verification_url: Optional[Nullable[str]]

Role connections verification URL for the app

rpc_origins: Optional[list[str]]

List of RPC origin URLs, if RPC is enabled

slug: Optional[str]

If this app is a game sold on Discord, this field will be the URL slug that links to the store page

tags: Optional[list[str]]

List of tags describing the content and functionality of the app. Max of 5 tags.

team: Nullable[Team]

If the app belongs to a team, this will be a list of the members of that team

terms_of_service_url: Optional[str]

URL of the app’s Terms of Service

verify_key: str

Hex encoded key for verification in interactions and the Game SDK’s GetTicket

class discord.objects.ApplicationCommandPermissions[source]

Application command permissions allow you to enable or disable commands for specific users, roles, or channels within a guild.

id: Snowflake

ID of the role, user, or channel. It can also be a permission constant

permission: bool

True to allow, False to disallow

type: ApplicationCommandPermissionType

Role, user, or channel

class discord.objects.ApplicationIntegrationTypeConfiguration[source]
oauth2_install_params: Optional[InstallParams]

Install params for each installation context’s default in-app authorization link

class discord.objects.AvatarDecorationData[source]

The data for the user’s avatar decoration

asset: str

The avatar decoration hash

sku_id: Snowflake

ID of the avatar decoration’s SKU

class discord.objects.Collectible[source]

The collectibles the user has, excluding Avatar Decorations and Profile Effects.

nameplate: Optional[Nameplate]

Object mapping of nameplate data

class discord.objects.Emoji[source]
animated: Optional[bool]

Whether this emoji is animated

available: Optional[bool]

Whether this emoji can be used, may be False due to loss of Server Boosts

id: Nullable[Snowflake]

Emoji ID

managed: Optional[bool]

Whether this emoji is managed

name: Nullable[str]

Emoji name; can be null only in reaction emoji objects

required_colons: Optional[bool]

Whether this emoji must be wrapped in colons

roles: Optional[list[Snowflake]]

Roles allowed to use this emoji

class discord.objects.Guild[source]

Represents an isolated collection of users and channels, and are often referred to as “servers” in the UI.

afk_channel_id: Nullable[Snowflake]

ID of AFK channel

afk_timeout: int

AFK timeout in seconds

application_id: Nullable[Snowflake]

Application ID of the guild creator if it is bot-created

approximate_member_count: Optional[int]

Approximate number of members in this guild, retunred from the GET /guilds/<id> and /users/@me/guilds endpoints when with_counts is True

approximate_presence_count: Optional[int]

Approximate number of non-offline members in this guild, returned from the GET /guilds/<id> and /users/@me/guilds endpoints when with_counts is True

banner: Nullable[str]

Banner hash

default_message_notifications: DefaultMessageNotificationLevel

Default message notifications level

description: Nullable[str]

The description of a guild

discovery_splash: Nullable[str]

Discovery splash hash; only present for guilds with the “DISCOVERABLE” feature

emojis: list[Emoji]

Custom guild emojis

explicit_content_filter: ExplicitContentFilterLevel

Explicit content filter level

features: list[GuildFeature]

Enabled guild feature

icon: Nullable[str]

Icon hash

icon_hash: Optional[Nullable[str]]

Icon hash, returned when in the template object

id: Snowflake

Guild ID

incidents_data: Nullable[IncidentsData]

The incidents data for this guild

max_members: Optional[int]

The maximum number of members for the guild

max_presences: Optional[Nullable[int]]

The maximum number of presences for the guild (None is always returned, arapt from the largest of guilds)

max_stage_video_channel_users: Optional[int]

The maximum amount of users in a stage video channel

max_video_channel_users: Optional[int]

The maximum amount of users in a video channel

mfa_level: MFALevel

Required MFA level for the guild

name: str

Guild name (2-100 characters, excluding trailing and leading whitespace)

nsfw_level: GuildAgeRestrictionLevel

Guild age-restriction level

owner: Optional[bool]

True if the user is the owner of the guild

owner_id: Snowflake

ID of the owner.

Note

This field is only sent when using the get_current_user_guilds() endpoint and are relative to the requested user.

permissions: Optional[PermissionFlag]

Total permissiosn for the user in the guild (excludes overwrites and implicit permissions).

Note

This field is only sent when using the get_current_user_guilds() endpoint and are relative to the requested user.

preferred_locale: Locale

The preferred locale of a Community guild; used in server discovery and notices from Discord, and sent in interactions; defaults to ENGLISH_US

premium_progress_bar_enabled: bool

Whether the guild has the boost progress bar enabled

premium_subscription_count: Optional[int]

The number of boosts this guild currently has

premium_tier: PremiumTier

Premium tier (Server Boost level)

public_updates_channel_id: Nullable[Snowflake]

The ID of the channel where admins and moderators of Community guilds receive notices from Discord

region: Optional[Nullable[str]]

Voice region Id of the guild (deprecated).

Note

This field is deprecated and is replaced by discord.objects.Channel.rtc_region.

roles: list[Role]

Roles in the guild

rules_channels_id: Nullable[Snowflake]

The ID of the channel where Community guilds can display rules and/or guidelines

safety_alerts_channel_id: Nullable[Snowflake]

The ID of the channel where admins and moderators of Community guilds receive safety alerts from Discord

splash: Nullable[str]

Splash hash

stickers: Optional[list[Sticker]]

Custom guild stickers

system_channel_flags: SystemChannelFlag

System channel flags

system_channel_id: Nullable[Snowflake]

The ID of the channel where guild notices such as welcome messages and boost events are posted

vanity_url_code: Nullable[str]

The vanity URL code for the guild

verification_level: VerificationLevel

Verification level required for the guild

welcome_screen: Optional[WelcomeScreen]

The welcome screen of a Community guild, shown to new members, returned in an Invite’s guild object

widget_channel_id: Optional[Nullable[Snowflake]]

The channel ID that the widget will generate an invite to, or None if set to no invite

widget_enabled: Optional[bool]

True if the server widget is enabled

class discord.objects.GuildApplicationCommandPermissions[source]

Returned when fetching the permissions for an app’s command(s) in a guild.

When the id field is the application ID instead of a command ID, the permissions apply to all commands that do not contain explicit overwrites.

application_id: Snowflake

ID of the application the command belongs to

guild_id: Snowflake

ID of the guild

id: Snowflake

ID of the command or the application ID

permissions: list[ApplicationCommandPermissions]

Permissions for the command in the guild, max of 100

class discord.objects.IncidentsData[source]
dm_spam_detected_at: Optional[Nullable[ISO8601Timestamp]]

When the dm spam was detected

dms_disabled_until: Nullable[ISO8601Timestamp]

When direct messages get enabled again

invites_disabled_until: Nullable[ISO8601Timestamp]

When invites get enabled again

raid_detected_at: Optional[Nullable[ISO8601Timestamp]]

When the raid was detected

class discord.objects.InstallParams[source]
permissions: PermissionFlag

Permissions to request for the bot role

scopes: list[str]

Scopes to add the application to the server with

class discord.objects.Nameplate[source]

The nameplate the user has.

asset: str

Path to the nameplate asset

label: str

The label of this nameplate. Currently unused

palette: NameplatePalette

Background color of the nameplate

sku_id: Snowflake

ID of the nameplate SKU

class discord.objects.Role[source]

Roles represent a set of permissions attached to a group of users.

color: int

Deprecated. Integer representation of hexadecimal color code.

Attention

color will still be returned by the API, but using the colors field is recommended when doing requests.

colors: RoleColors

The role’s colors

flags: RoleFlag

Role flags combined as a bitfield

hoist: bool

If this role is pinned in the user listing

icon: Optional[Nullable[str]]

Role icon hash

id: Snowflake

Role ID

managed: bool

Whether this role is managed by an integration

mentionable: bool

Whether this role is mentionable

name: str

Role name

permissions: PermissionFlag

Permission bit set

position: int

Position of this role (roles with the same position are sorted by ID)

tags: Optional[RoleTags]

The tags this role has

unicode_emoji: Optional[Nullable[str]]

Role unicode emoji

class discord.objects.SessionStartLimit[source]
max_concurrency: int

Number of identify requests allowed per 5 seconds

remaining: int

Remaining number of session starts the current user is allowed

reset_after: int

Number of milliseconds after which the limit resets

total: int

Total number of session starts the current user is allowed

class discord.Snowflake[source]

Represents a Discord snowflake

property increment: int

For every ID that is generated on that process, this number is incremented

property internal_process_id: int
property internal_worker_id: int
property timestamp: int

Milliseconds since Discord Epoch, the first second of 2015 or 1420070400000

to_datetime() datetime[source]

Returns the corresponding datetime.datetime object

class discord.objects.Sticker[source]

Represents a sticker that can be sent in messages.

available: Optional[bool]

Whether this guild sticker can be used, may be False due to loss of Server Boosts

description: Nullable[str]

Description of the sticker

format_type: StickerFormatType

Type of sticker format

guild_id: Optional[Snowflake]

ID of the guild that owns this sticker

id: Snowflake

ID of the sticker

name: str

Name of the sticker

pack_id: Optional[Snowflake]

For standard stickers, id of the pack the sticker is from

sort_value: Optional[int]

The standard sticker’s sort order within its pack

tags: list[str]

Autocomplete/suggestion tags for the sticker (max 200 characters).

Note

A comma separated list of keywords is the format used in this field by standard stickers, but this is just a convention. Incidentally the client will always use a name generated from an emoji as the value of this field when creating or modifying a guild sticker.

type: StickerType

Type of sticker

user: Optional[User]

The user that uploaded the guild sticker

class discord.objects.Team[source]
icon: Nullable[str]

Hash of the image of the team’s icon

id: Snowflake

Unique ID of the team

members: list[TeamMember]

Members of the team

name: str

Name of the team

owner_user_id: Snowflake

User ID of the current team owner

class discord.objects.TeamMember[source]
membership_state: MembershipState

User’s membership state on the team

role: TeamMemberRole

Role of the team member

team_id: Snowflake

ID of the parent team of which they are a member

user: User

Avatar, discriminator, ID, and username of the user

class discord.objects.UnavailableGuild[source]

Represents an Offline Guild, or a Guild whose information has not been provided through Guild Create events during the Gateway connect

id: Snowflake
unavailable: bool
class discord.objects.User[source]

Represents a Discord user

accent_color: Optional[Nullable[int]]

The user’s banner color encoded as an integer representation of hexadecimal color code

avatar: Nullable[str]

The user’s avatar hash

avatar_decoration_data: Optional[Nullable[AvatarDecorationData]]

Data for the user’s avatar decoration

banner: Optional[Nullable[str]]

The user’s banner hash

bot: Optional[bool]

Whether the user belongs to an OAuth2 application

collectibles: Optional[Nullable[Collectible]]

Data for the user’s collectibles

discriminator: str

The user’s Discord-tag

email: Optional[Nullable[str]]

The user’s email

flags: Optional[UserFlag]

The flags on a user’s account

global_name: Nullable[str]

The user’s display name, if it is set

id: Snowflake

The user’s id

locale: Optional[str]

The user’s chosen language option

mfa_enabled: Optional[bool]

Whether the user has two factor enabled on their account

premium_type: Optional[PremiumType]

The type of Nitro subscription on a user’s account

primary_guild: Optional[Nullable[UserPrimaryGuild]]

The user’s primary guild

public_flags: Optional[UserFlag]

The public flags on a user’s account

system: Optional[bool]

Whether the user is an Official Discord System user (part of the urgent message system)

username: str

The user’s username, not unique across the platform

verified: Optional[bool]

Whether the email on this account has been verified

class discord.objects.UserPrimaryGuild[source]
badge: Nullable[str]

The server tag badge hash

identity_enabled: Nullable[bool]

Whether the user is displaying the primary guild’s server tag. This can be None if the system clears the identity, e.g. the server no longer supports tags. This will be False if the user manually removes their tag.

identity_guild_id: Nullable[Snowflake]

The id of the user’s primary guild

tag: Nullable[str]

The text of the user’s server tag. Limited to 4 characters

class discord.objects.WelcomeScreen[source]
description: Nullable[str]

The server description shown in the welcome screen

welcome_channels: list[WelcomeScreenChannel]

The channels shown in the welcome screen, up to 5

class discord.objects.WelcomeScreenChannel[source]
channel_id: Snowflake

The channels’ ID

description: str

The description shown for the channel

emoji_id: Nullable[Snowflake]

The emoji ID, if the emoji is custom

emoji_name: Nullable[str]

The emoji name if custom, the unicode character if standard, or None if no emoji is set