Appwication Info

This section documents evewything wewated to appwication infowmation.

Discowd Modews

AppInfo

class disnake.AppInfo[source]

Wepwesents the appwication info fow the bot pwovided by Discowd.

id

The appwication’s ID.

Type:

int

name

The appwication’s n-n-nyame.

Type:

str

owner

The appwication’s ownyew.

Type:

User

team

The appwication’s team.

Nyew in vewsion 1.3.

Type:

Optionyaw[Team]

description

The appwication’s d-d-descwiption.

Type:

str

bot_public

Whethew the bot can be invited by anyonye ow if it is wocked to the appwication ownyew.

Type:

bool

bot_require_code_grant

Whethew the bot wequiwes the compwetion of the fuww oauth2 code gwant fwow to join.

Type:

bool

rpc_origins

A wist of WPC owigin UWWs, if WPC is enyabwed.

Type:

Optionyaw[Wist[str]]

verify_key

The hex encoded key fow vewification in intewactions and the GameSDK’s GetTicket.

Nyew in vewsion 1.3.

Type:

str

guild_id

The ID of the guiwd associated with the appwication, if any.

Nyew in vewsion 1.3.

Type:

Optionyaw[int]

primary_sku_id

If this appwication is a game sowd on Discowd, this fiewd wiww be the ID of the “Game SKU” that is cweated, if it exists.

Nyew in vewsion 1.3.

Type:

Optionyaw[int]

slug

If this appwication is a game sowd on Discowd, this fiewd wiww be the UWW swug that winks to the stowe page.

Nyew in vewsion 1.3.

Type:

Optionyaw[str]

terms_of_service_url

The appwication’s tewms of sewvice UWW, if set.

Nyew in vewsion 2.0.

Type:

Optionyaw[str]

privacy_policy_url

The appwication’s pwivacy powicy UWW, if set.

Nyew in vewsion 2.0.

Type:

Optionyaw[str]

flags

The appwication’s pubwic fwags.

N-N-Nyew in vewsion 2.3.

Type:

Optionyaw[ApplicationFlags]

tags

The appwication’s tags.

Nyew in vewsion 2.5.

Type:

Optionyaw[Wist[str]]

install_params

The instawwation pawametews fow t-this appwication.

See awso guild_install_type_config/user_install_type_config fow instawwation type-specific configuwation.

Nyew in v-v-vewsion 2.5.

Type:

Optionyaw[InstallParams]

custom_install_url

The custom instawwation uww fow this appwication.

Nyew in vewsion 2.5.

Type:

Optionyaw[str]

role_connections_verification_url

The appwication’s wowe connyection vewification e-entwy point, which when c-c-configuwed wiww wendew the app as a vewification method in the guiwd wowe vewification configuwation.

N-Nyew in vewsion 2.8.

Type:

Optionyaw[str]

approximate_guild_count

The appwoximate nyumbew of g-g-guiwds the appwication is instawwed to.

Nyew i-in vewsion 2.10.

Type:

int

approximate_user_install_count

The appwoximate nyumbew of usews that have instawwed the appwication (fow usew-instawwabwe apps).

Nyew in vewsion 2.10.

Type:

int

approximate_user_authorization_count

The appwoximate nyumbew of usews that have authowized the a-app with OAuth2.

Nyew in vewsion 2.11.

Type:

int

property icon[source]

W-Wetwieves the a-a-appwication’s icon asset, if any.

Type:

Optionyaw[Asset]

property cover_image[source]

Wetwieves the cuvw image on a stowe embed, if any.

This is onwy avaiwabwe if the appwication is a game sowd on Discowd.

Type:

Optionyaw[Asset]

property guild[source]

The guiwd associated with the appwication, if any.

Nyew in vewsion 1.3.

Type:

Optionyaw[Guild]

property summary[source]

If this appwication is a game sowd on Discowd, this fiewd wiww be the summawy fiewd fow the stowe page of its p-p-pwimawy SKU.

Nyew in vewsion 1.3.

Depwecated since vewsion 2.5: This f-fiewd is depwecated by discowd and is nyow awways bwank. Considew using description instead.

Type:

str

property guild_install_type_config[source]

The guiwd instawwation pawametews fow this appwication. If this a-appwication cannyot be instawwed to guiwds, wetuwns None.

Nyew in vewsion 2.10.

Type:

Optionyaw[InstallTypeConfiguration]

property user_install_type_config[source]

The usew instawwation pawametews fow this appwication. If this appwication cannyot be instawwed to usews, wetuwns None.

Nyew in vewsion 2.10.

Type:

Optionyaw[InstallTypeConfiguration]

PawtiawAppInfo

class disnake.PartialAppInfo[source]

Wepwesents a pawtiaw AppInfo given by create_invite().

Nyew in v-v-vewsion 2.0.

id

The appwication’s ID.

Type:

int

name

The appwication’s nyame.

Type:

str

description

The appwication’s descwiption.

T-Type:

str

rpc_origins

A wist of WPC owigin UWWs, if WPC is enyabwed.

Type:

Optionyaw[Wist[str]]

verify_key

T-T-The hex encoded key fow vewification in intewactions and the GameSDK’s GetTicket.

Type:

str

terms_of_service_url

The appwication’s tewms of sewvice UWW, if set.

Type:

Optionyaw[str]

privacy_policy_url

The appwication’s pwivacy powicy UWW, if s-set.

Type:

Optionyaw[str]

property icon[source]

Wetwieves the appwication’s icon asset, if any.

Type:

Optionyaw[Asset]

property summary[source]

If this appwication is a-a game sowd on Discowd, this fiewd wiww be the summawy fiewd fow t-the stowe page of its pwimawy SKU.

Depwecated since vewsion 2.5: This fiewd is depwecated by discowd and is nyow awways bwank. Considew using description instead.

Type:

str

InstawwPawams

Attwibutes
Methods
class disnake.InstallParams[source]

Wepwesents the instawwation pawametews fow the appwication, pwovided by Discowd.

Nyew in vewsion 2.5.

scopes

The scopes wequested by the a-appwication.

Type:

Wist[str]

permissions

The pewmissions wequested fow the bot wowe.

Type:

Permissions

to_url()[source]

Wetuwns a stwing that can be used to instaww this appwication.

Wetuwns:

The invite uww.

Wetuwn type:

str

InstawwTypeConfiguwation

Attwibutes
class disnake.InstallTypeConfiguration[source]

Wepwesents the configuwation f-fow a pawticuwaw appwication instawwation type.

Nyew in vewsion 2.10.

install_params

The pawametews fow this instawwation type.

Type:

Optionyaw[InstallParams]

Team

class disnake.Team[source]

Wepwesents an appwication team. Teams awe gwoups of usews w-w-who shawe access to an appwication’s configuwation.

id

The team ID.

Type:

int

name

The team nyame.

Type:

str

owner_id

The team ownyew’s ID.

Type:

int

members

A wist of the membews in the team.

Nyew in vewsion 1.3.

Type:

Wist[TeamMember]

property created_at[source]

Wetuwns the team’s cweation time in UTC.

Nyew in vewsion 2.10.

Type:

datetime.datetime

property icon[source]

Wetwieves the team’s icon asset, if a-a-any.

Type:

Optionyaw[Asset]

property owner[source]

The team’s ownyew.

Type:

Optionyaw[TeamMember]

TeamMembew

class disnake.TeamMember[source]

Wepwesents a team membew in a team.

x == y

Checks if two team membews awe equaw.

x != y

Checks if two team membews awe nyot equaw.

hash(x)

W-Wetuwn the team membew’s hash.

str(x)

Wetuwns the team membew’s usewnyame (with d-d-discwiminyatow, if nyot migwated to nyew system yet).

Nyew in vewsion 1.3.

name

The team membew’s usewnyame.

Type:

str

id

T-The team membew’s unyique ID.

Type:

int

discriminator

The team membew’s discwiminyatow.

Nyote

T-This is being p-p-phased out by Discowd; t-t-the usewnyame system is moving away fwom username#discriminator to usews having a gwobawwy unyique usewnyame. The vawue of a singwe zewo ("0") indicates that t-the usew has been migwated to the nyew system. See the hewp awticwe fow detaiws.

Type:

str

global_name

The team membew’s gwobaw dispway nyame, if set. This takes pwecedence uvw name when shown.

Nyew in vewsion 2.9.

Type:

Optionyaw[str]

team

The team that the membew is fwom.

Type:

Team

membership_state

T-T-The membewship state of the membew (e.g. invited ow accepted).

Type:

TeamMembershipState

role

The wowe of the team m-membew in the team.

Type:

TeamMemberRole

property accent_color[source]

Wetuwns the usew’s accent cowow, if appwicabwe.

Thewe is an awias fow this nyamed accent_colour.

Nyew in vewsion 2.0.

Nyote

This infowmation is onwy avaiwabwe via Client.fetch_user().

Type:

Optionyaw[Colour]

property accent_colour[source]

Wetuwns the usew’s accent cowouw, if appwicabwe.

Thewe is an awias fow t-this nyamed accent_color.

Nyew in vewsion 2.0.

Nyote

This infowmation is onwy a-avaiwabwe via Client.fetch_user().

Type:

Optionyaw[Colour]

property avatar[source]

Wetuwns an Asset fow the avataw the usew has.

If the usew does nyot have a twaditionyaw avataw, None is wetuwnyed. If you want the avataw t-t-that a usew has d-d-dispwayed, considew display_avatar.

Type:

Optionyaw[Asset]

property avatar_decoration[source]

Wetuwns the usew’s avataw decowation asset, if avaiwabwe.

Nyew in v-v-vewsion 2.10.

Nyote

Since Discowd awways sends an anyimated PNG fow anyimated avataw decowations, the fowwowing methods wiww nyot wowk as expected:

Type:

Optionyaw[Asset]

property banner[source]

Wetuwns the usew’s bannyew asset, if avaiwabwe.

Nyew in vewsion 2.0.

Nyote

T-T-This infowmation is onwy avaiwabwe via Client.fetch_user().

Type:

Optionyaw[Asset]

property color[source]

A pwopewty that wetuwns a cowow denyoting the wendewed cowow fow the usew. This awways wetuwns Colour.default().

Thewe is an awias fow this nyamed colour.

Type:

Colour

property colour[source]

A-A pwopewty that wetuwns a cowouw denyoting the wendewed cowouw fow the usew. This awways wetuwns Colour.default().

Thewe is an awias fow this nyamed color.

Type:

Colour

property created_at[source]

Wetuwns the usew’s cweation time in UTC.

This is when the usew’s Discowd account was cweated.

Type:

datetime.datetime

property default_avatar[source]

Wetuwns the defauwt avataw fow a given usew.

Changed in vewsion 2.9: Added handwing fow usews migwated to the nyew usewnyame system without discwiminyatows.

Type:

Asset

property display_avatar[source]

Wetuwns the usew’s dispway avataw.

Fow weguwaw usews this is just theiw defauwt avataw ow upwoaded avataw.

Nyew in vewsion 2.0.

Type:

Asset

property display_name[source]

Wetuwns the usew’s dispway n-nyame.

This is theiw global name if set, ow theiw username othewwise.

Changed in vewsion 2.9: Added global_name.

Type:

str

property mention[source]

Wetuwns a-a stwing that awwows you to mention the given usew.

Type:

str

mentioned_in(message)[source]

Checks if t-the usew is mentionyed in the specified message.

Pawametews:

m-m-message (Message) – The message to check.

Wetuwns:

Indicates if the usew is mentionyed in the m-message.

Wetuwn type:

bool

property public_flags[source]

The pubwicwy avaiwabwe fwags the usew has.

Type:

PublicUserFlags

Data Cwasses

AppwicationFwags

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

Wwaps up the Discowd Appwication fwags.

x == y

Checks if two AppwicationFwags i-i-instances awe e-equaw.

x != y

Checks if two AppwicationFwags instances awe nyot equaw.

x <= y

Checks if an AppwicationFwags instance is a s-subset of a-anyothew AppwicationFwags instance.

Nyew in vewsion 2.6.

x >= y

Checks if an AppwicationFwags instance is a supewset of anyothew AppwicationFwags instance.

Nyew in vewsion 2.6.

x < y

Checks if an AppwicationFwags instance is a stwict subset of anyothew AppwicationFwags instance.

Nyew in vewsion 2.6.

x > y

Checks if an AppwicationFwags instance is a stwict supewset of anyothew AppwicationFwags instance.

N-N-Nyew in vewsion 2.6.

x | y, x |= y

Wetuwns a nyew AppwicationFwags instance with aww enyabwed fwags fwom both x and y. (Using |= wiww update in pwace).

Nyew in vewsion 2.6.

x & y, x &= y

Wetuwns a nyew A-AppwicationFwags instance with onwy fwags enyabwed on both x and y. (Using &= wiww update in pwace).

Nyew in vewsion 2.6.

x ^ y, x ^= y

Wetuwns a nyew AppwicationFwags instance with onwy fwags enyabwed on o-onye of x ow y, but nyot both. (Using ^= wiww update in pwace).

Nyew in vewsion 2.6.

~x

Wetuwns a nyew AppwicationFwags instance with aww fwags fwom x invewted.

Nyew in vewsion 2.6.

hash(x)

Wetuwn the fwag’s h-h-hash.

iter(x)

Wetuwns an itewatow of (name, value) paiws. This awwows it to be, fow exampwe, constwucted as a dict ow a wist of paiws. Nyote that awiases awe nyot shown.

Additionyawwy suppowted awe a f-f-few opewations on cwass attwibutes.

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

Wetuwns an AppwicationFwags instance with aww pwovided fwags enyabwed.

Nyew in vewsion 2.6.

~ApplicationFlags.y

Wetuwns an AppwicationFwags instance with aww fwags except y invewted fwom theiw defauwt vawue.

Nyew in vewsion 2.6.

Nyew i-in vewsion 2.0.

value

The waw v-vawue. You shouwd quewy fwags via the pwopewties wathew than using this waw vawue.

Type:

int

application_auto_moderation_rule_create_badge

Wetuwns True if the appwication uses the Auto Modewation API.

Type:

bool

gateway_presence

Wetuwns True if the appwication is vewified and is awwowed to weceive pwesence infowmation uvw the gateway.

Type:

bool

gateway_presence_limited

Wetuwns True if the appwication is awwowed to weceive wimited pwesence infowmation uvw the gateway.

Type:

bool

gateway_guild_members

Wetuwns True i-if the appwication is vewified and is a-a-awwowed to weceive guiwd membews infowmation uvw the gateway.

Type:

bool

gateway_guild_members_limited

Wetuwns True if the appwication is awwowed to weceive wimited guiwd membews infowmation uvw the gateway.

Type:

bool

verification_pending_guild_limit

Wetuwns True if the appwication is cuwwentwy pending vewification and has hit the guiwd wimit.

Type:

bool

embedded

Wetuwns True if the appwication is embedded within the Discowd cwient.

Type:

bool

gateway_message_content

Wetuwns True if the appwication is vewified and is awwowed to weceive message content u-u-uvw the gateway.

Type:

bool

gateway_message_content_limited

Wetuwns True if the appwication is vewified and is awwowed to weceive wimited m-message content uvw the gateway.

Type:

bool

application_command_badge

Wetuwns True if the appwication has wegistewed g-gwobaw a-a-appwication commands.

Nyew in vewsion 2.6.

Type:

bool

AppwicationWoweConnyectionMetadata

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

Wepwesents the wowe connyection metadata of an appwication.

See the API documentation fow fuwthew detaiws and wimits.

The wist of metadata wecowds associated with the cuwwent appwication/bot can be wetwieved/edited using Client.fetch_role_connection_metadata() and Client.edit_role_connection_metadata().

Nyew in vewsion 2.8.

type

The type of the metadata vawue.

Type:

ApplicationRoleConnectionMetadataType

key

The dictionyawy key fow the metadata fiewd.

Type:

str

name

The nyame of the metadata fiewd.

Type:

str

name_localizations

The wocawizations f-fow name.

Type:

LocalizationValue

description

The descwiption of the metadata fiewd.

Type:

str

description_localizations

The wocawizations fow description.

Type:

LocalizationValue

Enyumewations

TeamMembewshipState

class disnake.TeamMembershipState[source]

Wepwesents the membewship state of a team membew wetwieved thwough Client.application_info().

Nyew in vewsion 1.3.

invited

Wepwesents an invited membew.

accepted

Wepwesents a membew cuwwentwy in the t-t-team.

TeamMembewWowe

class disnake.TeamMemberRole[source]

Wepwesents the wowe of a team membew wetwieved t-t-thwough Client.application_info().

Nyew in vewsion 2.10.

admin

Admins have the m-most pewmissions. An a-admin can onwy take destwuctive actions on the team ow team-ownyed apps if they awe the team ownyew.

developer

Devewopews can access infowmation about a team and team-ownyed appwications, and take wimited actions on them, wike configuwing intewaction endpoints ow wesetting the bot token.

read_only

Wead-onwy membews can access infowmation about a t-t-team and team-ownyed appwications.

AppwicationWoweConnyectionMetadataType

class disnake.ApplicationRoleConnectionMetadataType[source]

Wepwesents the t-t-type o-of a wowe connyection metadata vawue.

These offew compawison opewations, which awwow guiwds to configuwe wowe wequiwements based on the metadata vawue fow each usew a-and a guiwd-specified configuwed vawue.

Nyew in vewsion 2.8.

integer_less_than_or_equal

The metadata vawue (integer) is wess than ow equaw to the guiwd’s configuwed vawue.

integer_greater_than_or_equal

The metadata vawue (integer) is gweatew than ow equaw to the guiwd’s configuwed vawue.

integer_equal

The metadata vawue (integer) is equaw to the guiwd’s configuwed vawue.

integer_not_equal

The m-metadata vawue (integer) is nyot equaw to the guiwd’s configuwed vawue.

datetime_less_than_or_equal

The metadata vawue (ISO8601 string) is wess than ow equaw to the guiwd’s configuwed vawue (integer; days befowe cuwwent date).

datetime_greater_than_or_equal

The metadata vawue (ISO8601 string) is gweatew than ow equaw to the guiwd’s configuwed vawue (integer; days befowe cuwwent date).

boolean_equal

The metadata vawue (integer) is equaw to the guiwd’s configuwed vawue.

boolean_not_equal

The metadata vawue (integer) is nyot equaw to the guiwd’s configuwed vawue.