Application Info

This section documents everything related to application information.

Discord Models

AppInfo

class disnake.AppInfo[source]

Represents the application info for the bot provided by Discord.

id

The application’s ID.

Type:

int

name

The application’s name.

Type:

str

owner

The application’s owner.

Type:

User

team

The application’s team.

New in version 1.3.

Type:

Optional[Team]

description

The application’s description.

Type:

str

bot_public

Whether the bot can be invited by anyone or if it is locked to the application owner.

Type:

bool

bot_require_code_grant

Whether the bot requires the completion of the full oauth2 code grant flow to join.

Type:

bool

rpc_origins

A list of RPC origin URLs, if RPC is enabled.

Type:

Optional[List[str]]

verify_key

The hex encoded key for verification in interactions and the GameSDK’s GetTicket.

New in version 1.3.

Type:

str

guild_id

If this application is a game sold on Discord, this field will be the guild to which it has been linked to.

New in version 1.3.

Type:

Optional[int]

primary_sku_id

If this application is a game sold on Discord, this field will be the ID of the “Game SKU” that is created, if it exists.

New in version 1.3.

Type:

Optional[int]

slug

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

New in version 1.3.

Type:

Optional[str]

terms_of_service_url

The application’s terms of service URL, if set.

New in version 2.0.

Type:

Optional[str]

privacy_policy_url

The application’s privacy policy URL, if set.

New in version 2.0.

Type:

Optional[str]

flags

The application’s public flags.

New in version 2.3.

Type:

Optional[ApplicationFlags]

tags

The application’s tags.

New in version 2.5.

Type:

Optional[List[str]]

install_params

The installation parameters for this application.

New in version 2.5.

Type:

Optional[InstallParams]

custom_install_url

The custom installation url for this application.

New in version 2.5.

Type:

Optional[str]

role_connections_verification_url

The application’s role connection verification entry point, which when configured will render the app as a verification method in the guild role verification configuration.

New in version 2.8.

Type:

Optional[str]

property icon[source]

Retrieves the application’s icon asset, if any.

Type:

Optional[Asset]

property cover_image[source]

Retrieves the cover image on a store embed, if any.

This is only available if the application is a game sold on Discord.

Type:

Optional[Asset]

property guild[source]

If this application is a game sold on Discord, this field will be the guild to which it has been linked

New in version 1.3.

Type:

Optional[Guild]

property summary[source]

If this application is a game sold on Discord, this field will be the summary field for the store page of its primary SKU.

New in version 1.3.

Deprecated since version 2.5: This field is deprecated by discord and is now always blank. Consider using description instead.

Type:

str

PartialAppInfo

class disnake.PartialAppInfo[source]

Represents a partial AppInfo given by create_invite().

New in version 2.0.

id

The application’s ID.

Type:

int

name

The application’s name.

Type:

str

description

The application’s description.

Type:

str

rpc_origins

A list of RPC origin URLs, if RPC is enabled.

Type:

Optional[List[str]]

verify_key

The hex encoded key for verification in interactions and the GameSDK’s GetTicket.

Type:

str

terms_of_service_url

The application’s terms of service URL, if set.

Type:

Optional[str]

privacy_policy_url

The application’s privacy policy URL, if set.

Type:

Optional[str]

property icon[source]

Retrieves the application’s icon asset, if any.

Type:

Optional[Asset]

property summary[source]

If this application is a game sold on Discord, this field will be the summary field for the store page of its primary SKU.

Deprecated since version 2.5: This field is deprecated by discord and is now always blank. Consider using description instead.

Type:

str

InstallParams

Attributes
Methods
class disnake.InstallParams[source]

Represents the installation parameters for the application, provided by Discord.

New in version 2.5.

scopes

The scopes requested by the application.

Type:

List[str]

permissions

The permissions requested for the bot role.

Type:

Permissions

to_url()[source]

Return a string that can be used to add this application to a server.

Returns:

The invite url.

Return type:

str

Team

class disnake.Team[source]

Represents an application team for a bot provided by Discord.

id

The team ID.

Type:

int

name

The team name.

Type:

str

owner_id

The team’s owner ID.

Type:

int

members

A list of the members in the team.

New in version 1.3.

Type:

List[TeamMember]

property icon[source]

Retrieves the team’s icon asset, if any.

Type:

Optional[Asset]

property owner[source]

The team’s owner.

Type:

Optional[TeamMember]

TeamMember

class disnake.TeamMember[source]

Represents a team member in a team.

x == y

Checks if two team members are equal.

x != y

Checks if two team members are not equal.

hash(x)

Return the team member’s hash.

str(x)

Returns the team member’s username (with discriminator, if not migrated to new system yet).

New in version 1.3.

name

The team member’s username.

Type:

str

id

The team member’s unique ID.

Type:

int

discriminator

The team member’s discriminator.

Note

This is being phased out by Discord; the username system is moving away from username#discriminator to users having a globally unique username. The value of a single zero ("0") indicates that the user has been migrated to the new system. See the help article for details.

Type:

str

global_name

The team members’s global display name, if set. This takes precedence over name when shown.

New in version 2.9.

Type:

Optional[str]

avatar[source]

The avatar hash the team member has. Could be None.

Type:

Optional[str]

bot

Specifies if the user is a bot account.

Type:

bool

team

The team that the member is from.

Type:

Team

membership_state

The membership state of the member (e.g. invited or accepted)

Type:

TeamMembershipState

Data Classes

ApplicationFlags

class disnake.ApplicationFlags(**kwargs)[source]

Wraps up the Discord Application flags.

x == y

Checks if two ApplicationFlags instances are equal.

x != y

Checks if two ApplicationFlags instances are not equal.

x <= y

Checks if an ApplicationFlags instance is a subset of another ApplicationFlags instance.

New in version 2.6.

x >= y

Checks if an ApplicationFlags instance is a superset of another ApplicationFlags instance.

New in version 2.6.

x < y

Checks if an ApplicationFlags instance is a strict subset of another ApplicationFlags instance.

New in version 2.6.

x > y

Checks if an ApplicationFlags instance is a strict superset of another ApplicationFlags instance.

New in version 2.6.

x | y, x |= y

Returns a new ApplicationFlags instance with all enabled flags from both x and y. (Using |= will update in place).

New in version 2.6.

x & y, x &= y

Returns a new ApplicationFlags instance with only flags enabled on both x and y. (Using &= will update in place).

New in version 2.6.

x ^ y, x ^= y

Returns a new ApplicationFlags instance with only flags enabled on one of x or y, but not both. (Using ^= will update in place).

New in version 2.6.

~x

Returns a new ApplicationFlags instance with all flags from x inverted.

New in version 2.6.

hash(x)

Return the flag’s hash.

iter(x)

Returns an iterator of (name, value) pairs. This allows it to be, for example, constructed as a dict or a list of pairs. Note that aliases are not shown.

Additionally supported are a few operations on class attributes.

ApplicationFlags.y | ApplicationFlags.z, ApplicationFlags(y=True) | ApplicationFlags.z

Returns a ApplicationFlags instance with all provided flags enabled.

New in version 2.6.

~ApplicationFlags.y

Returns a ApplicationFlags instance with all flags except y inverted from their default value.

New in version 2.6.

New in version 2.0.

value

The raw value. You should query flags via the properties rather than using this raw value.

Type:

int

application_auto_moderation_rule_create_badge

Returns True if the application uses the Auto Moderation API.

Type:

bool

gateway_presence

Returns True if the application is verified and is allowed to receive presence information over the gateway.

Type:

bool

gateway_presence_limited

Returns True if the application is allowed to receive limited presence information over the gateway.

Type:

bool

gateway_guild_members

Returns True if the application is verified and is allowed to receive guild members information over the gateway.

Type:

bool

gateway_guild_members_limited

Returns True if the application is allowed to receive limited guild members information over the gateway.

Type:

bool

verification_pending_guild_limit

Returns True if the application is currently pending verification and has hit the guild limit.

Type:

bool

embedded

Returns True if the application is embedded within the Discord client.

Type:

bool

gateway_message_content

Returns True if the application is verified and is allowed to receive message content over the gateway.

Type:

bool

gateway_message_content_limited

Returns True if the application is verified and is allowed to receive limited message content over the gateway.

Type:

bool

application_command_badge

Returns True if the application has registered global application commands.

New in version 2.6.

Type:

bool

ApplicationRoleConnectionMetadata

class disnake.ApplicationRoleConnectionMetadata(*, type, key, name, description)[source]

Represents the role connection metadata of an application.

See the API documentation for further details and limits.

The list of metadata records associated with the current application/bot can be retrieved/edited using Client.fetch_role_connection_metadata() and Client.edit_role_connection_metadata().

New in version 2.8.

type

The type of the metadata value.

Type:

ApplicationRoleConnectionMetadataType

key

The dictionary key for the metadata field.

Type:

str

name

The name of the metadata field.

Type:

str

name_localizations

The localizations for name.

Type:

LocalizationValue

description

The description of the metadata field.

Type:

str

description_localizations

The localizations for description.

Type:

LocalizationValue

Enumerations

TeamMembershipState

class disnake.TeamMembershipState[source]

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

New in version 1.3.

invited

Represents an invited member.

accepted

Represents a member currently in the team.

ApplicationRoleConnectionMetadataType

class disnake.ApplicationRoleConnectionMetadataType[source]

Represents the type of a role connection metadata value.

These offer comparison operations, which allow guilds to configure role requirements based on the metadata value for each user and a guild-specified configured value.

New in version 2.8.

integer_less_than_or_equal

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

integer_greater_than_or_equal

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

integer_equal

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

integer_not_equal

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

datetime_less_than_or_equal

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

datetime_greater_than_or_equal

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

boolean_equal

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

boolean_not_equal

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