Application Info¶
This section documents everything related to application information.
Discord Models¶
AppInfo¶
- approximate_guild_count
- approximate_user_authorization_count
- approximate_user_install_count
- bot_public
- bot_require_code_grant
- cover_image
- custom_install_url
- description
- event_webhooks_status
- event_webhooks_types
- event_webhooks_url
- flags
- guild
- guild_id
- guild_install_type_config
- icon
- id
- install_params
- interactions_endpoint_url
- name
- owner
- primary_sku_id
- privacy_policy_url
- redirect_uris
- role_connections_verification_url
- rpc_origins
- slug
- summary
- tags
- team
- terms_of_service_url
- user_install_type_config
- verify_key
- asyncedit
- class disnake.AppInfo[source]¶
Represents the application info for the bot provided by Discord.
- bot_public¶
Whether the bot can be invited by anyone or if it is locked to the application owner.
- Type:
- bot_require_code_grant¶
Whether the bot requires the completion of the full oauth2 code grant flow to join.
- Type:
- verify_key¶
The hex encoded key for verification in interactions and the GameSDK’s GetTicket.
Added in version 1.3.
- Type:
- guild_id¶
The ID of the guild associated with the application, if any.
Added 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.
Added 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.
Added in version 1.3.
- Type:
Optional[
str
]
- terms_of_service_url¶
The application’s terms of service URL, if set.
Added in version 2.0.
- Type:
Optional[
str
]
- privacy_policy_url¶
The application’s privacy policy URL, if set.
Added in version 2.0.
- Type:
Optional[
str
]
- flags¶
The application’s public flags.
Added in version 2.3.
- Type:
Optional[
ApplicationFlags
]
- install_params¶
The installation parameters for this application.
See also
guild_install_type_config
/user_install_type_config
for installation type-specific configuration.Added in version 2.5.
- Type:
Optional[
InstallParams
]
- custom_install_url¶
The custom installation url for this application.
Added 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.
Added in version 2.8.
- Type:
Optional[
str
]
- approximate_guild_count¶
The approximate number of guilds the application is installed to.
Added in version 2.10.
- Type:
- approximate_user_install_count¶
The approximate number of users that have installed the application (for user-installable apps).
Added in version 2.10.
- Type:
- approximate_user_authorization_count¶
The approximate number of users that have authorized the app with OAuth2.
Added in version 2.11.
- Type:
- redirect_uris¶
The application’s OAuth2 redirect URIs.
Added in version 2.11.
- Type:
Optional[List[
str
]]
- interactions_endpoint_url¶
The application’s interactions endpoint URL.
Added in version 2.11.
- Type:
Optional[
str
]
- event_webhooks_url¶
The application’s event webhooks URL.
Added in version 2.11.
- Type:
Optional[
str
]
- event_webhooks_status¶
The application’s event webhooks status.
Added in version 2.11.
- event_webhooks_types¶
The application’s event webhook types, if any.
Added in version 2.11.
- Type:
Optional[List[
str
]]
- property cover_image[source]¶
Retrieves the rich presence cover image asset, if any.
- Type:
Optional[
Asset
]
- property guild[source]¶
The guild associated with the application, if any.
Added 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.
Added 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:
- property guild_install_type_config[source]¶
The guild installation parameters for this application. If this application cannot be installed to guilds, returns
None
.Added in version 2.10.
- Type:
Optional[
InstallTypeConfiguration
]
- property user_install_type_config[source]¶
The user installation parameters for this application. If this application cannot be installed to users, returns
None
.Added in version 2.10.
- Type:
Optional[
InstallTypeConfiguration
]
- await edit(*, custom_install_url=..., description=..., role_connections_verification_url=..., install_params=..., guild_install_type_config=..., user_install_type_config=..., flags=..., icon=..., cover_image=..., interactions_endpoint_url=..., tags=..., event_webhooks_url=..., event_webhooks_status=..., event_webhooks_types=...)[source]¶
This function is a coroutine.
Edit’s the application’s information.
All parameters are optional.
Added in version 2.12.0a.
- Parameters:
custom_install_url (Optional[
str
]) – The custom installation url for this application.description (Optional[
str
]) – The application’s description.role_connections_verification_url (Optional[
str
]) – 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.install_params (Optional[
InstallParams
]) –The installation parameters for this application.
If provided with
custom_install_url
, must be set toNone
.It’s recommended to use
guild_install_type_config
anduser_install_type_config
instead of this parameter, as this parameter is soft-deprecated by Discord.bot_public
must beTrue
if this parameter is provided.guild_install_type_config (Optional[
InstallTypeConfiguration
]) –The guild installation type configuration for this application. If set to
None
, guild installations will be disabled. You cannot disable both user and guild installations.Note the only valid scopes for guild installations are
applications.commands
andbot
.user_install_type_config (Optional[
InstallTypeConfiguration
]) –The user installation type configuration for this application. If set to
None
, user installations will be disabled. You cannot disable both user and guild installations.Note the only valid scopes for user installations are
applications.commands
.flags (
ApplicationFlags
) –The application’s public flags.
This is restricted to only affecting the limited intent flags:
gateway_guild_members_limited
,gateway_presence_limited
, andgateway_message_content_limited
.Warning
Disabling an intent that you are currently requesting during your current session will cause you to be disconnected from the gateway. Take caution when providing this parameter.
icon (Optional[Union[
bytes
,Asset
,Emoji
,PartialEmoji
,StickerItem
,Sticker
]]) – Update the application’s icon asset, if any.cover_image (Optional[Union[
bytes
,Asset
,Emoji
,PartialEmoji
,StickerItem
,Sticker
]]) – Update the cover_image for rich presence integrations.interactions_endpoint_url (Optional[
str
]) – The application’s interactions endpoint URL.tags (List[
str
]) – The application’s tags.event_webhooks_url (Optional[
str
]) – The application’s event webhooks URL.event_webhooks_status (
ApplicationEventWebhookStatus
) – The application’s event webhooks status.event_webhooks_types (Optional[List[
str
]]) – The application’s event webhook types. See webhook event types for a list of valid events.
- Raises:
HTTPException – Editing the application information failed.
- Returns:
The new application information.
- Return type:
Examples
>>> app_info = await client.application_info() >>> await app_info.edit(description="A new description!")
To enable user installations while using custom install URL.
>>> from disnake import InstallTypeConfiguration >>> await app_info.edit( ... user_install_type_config=InstallTypeConfiguration() ... )
To disable user installations and guild installations. Note, both cannot be disabled simultaneously.
>>> await app_info.edit( ... custom_install_url="https://example.com/install", ... # to disable user installations ... user_install_type_config=None, ... # to disable guild installations ... guild_install_type_config=None, ... )
PartialAppInfo¶
- class disnake.PartialAppInfo[source]¶
Represents a partial AppInfo given by
create_invite()
.Added in version 2.0.
- 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:
InstallParams¶
- defto_url
- class disnake.InstallParams[source]¶
Represents the installation parameters for the application, provided by Discord.
Added in version 2.5.
Changed in version 2.12.0a: This class can now be created by users.
- permissions¶
The permissions requested for the bot role.
- Type:
- to_url()[source]¶
Returns a string that can be used to install this application.
Note
This method can only be used on InstallParams that have been created by
Client.application_info()
- Returns:
The invite url.
- Return type:
InstallTypeConfiguration¶
- class disnake.InstallTypeConfiguration[source]¶
Represents the configuration for a particular application installation type.
Added in version 2.10.
Changed in version 2.12.0a: This class can now be created by users.
- install_params¶
The parameters for this installation type.
- Type:
Optional[
InstallParams
]
Team¶
- class disnake.Team[source]¶
Represents an application team. Teams are groups of users who share access to an application’s configuration.
- members¶
A list of the members in the team.
Added in version 1.3.
- Type:
List[
TeamMember
]
- property owner[source]¶
The team’s owner.
- Type:
Optional[
TeamMember
]
TeamMember¶
- defmentioned_in
- 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).
Added in version 1.3.
- 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:
- global_name¶
The team member’s global display name, if set. This takes precedence over
name
when shown.Added in version 2.9.
- Type:
Optional[
str
]
- membership_state¶
The membership state of the member (e.g. invited or accepted).
- Type:
- role¶
The role of the team member in the team.
- Type:
- property accent_color[source]¶
Returns the user’s accent color, if applicable.
There is an alias for this named
accent_colour
.Added in version 2.0.
Note
This information is only available via
Client.fetch_user()
.- Type:
Optional[
Colour
]
- property accent_colour[source]¶
Returns the user’s accent colour, if applicable.
There is an alias for this named
accent_color
.Added in version 2.0.
Note
This information is only available via
Client.fetch_user()
.- Type:
Optional[
Colour
]
- property avatar[source]¶
Returns an
Asset
for the avatar the user has.If the user does not have a traditional avatar,
None
is returned. If you want the avatar that a user has displayed, considerdisplay_avatar
.- Type:
Optional[
Asset
]
- property avatar_decoration[source]¶
Returns the user’s avatar decoration asset, if available.
Added in version 2.10.
Note
Since Discord always sends an animated PNG for animated avatar decorations, the following methods will not work as expected:
- Type:
Optional[
Asset
]
- property banner[source]¶
Returns the user’s banner asset, if available.
Added in version 2.0.
Note
This information is only available via
Client.fetch_user()
.- Type:
Optional[
Asset
]
- property color[source]¶
A property that returns a color denoting the rendered color for the user. This always returns
Colour.default()
.There is an alias for this named
colour
.- Type:
- property colour[source]¶
A property that returns a colour denoting the rendered colour for the user. This always returns
Colour.default()
.There is an alias for this named
color
.- Type:
- property created_at[source]¶
Returns the user’s creation time in UTC.
This is when the user’s Discord account was created.
- Type:
- property default_avatar[source]¶
Returns the default avatar for a given user.
Changed in version 2.9: Added handling for users migrated to the new username system without discriminators.
- Type:
- property display_avatar[source]¶
Returns the user’s display avatar.
For regular users this is just their default avatar or uploaded avatar.
Added in version 2.0.
- Type:
- property display_name[source]¶
Returns the user’s display name.
This is their
global name
if set, or theirusername
otherwise.Changed in version 2.9: Added
global_name
.- Type:
- property primary_guild[source]¶
Returns the user’s primary guild, if any.
Added in version 2.11.
- Type:
Optional[
PrimaryGuild
]
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.
Added in version 2.6.
- x >= y
Checks if an ApplicationFlags instance is a superset of another ApplicationFlags instance.
Added in version 2.6.
- x < y
Checks if an ApplicationFlags instance is a strict subset of another ApplicationFlags instance.
Added in version 2.6.
- x > y
Checks if an ApplicationFlags instance is a strict superset of another ApplicationFlags instance.
Added 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).Added 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).Added 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).Added in version 2.6.
- ~x
Returns a new ApplicationFlags instance with all flags from x inverted.
Added 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 an ApplicationFlags instance with all provided flags enabled.
Added in version 2.6.
- ~ApplicationFlags.y
Returns an ApplicationFlags instance with all flags except
y
inverted from their default value.Added in version 2.6.
Added in version 2.0.
- value¶
The raw value. You should query flags via the properties rather than using this raw value.
- Type:
- application_auto_moderation_rule_create_badge¶
Returns
True
if the application uses the Auto Moderation API.- Type:
- gateway_presence¶
Returns
True
if the application is verified and is allowed to receive presence information over the gateway.- Type:
- gateway_presence_limited¶
Returns
True
if the application is allowed to receive limited presence information over the gateway.- Type:
- gateway_guild_members¶
Returns
True
if the application is verified and is allowed to receive guild members information over the gateway.- Type:
- gateway_guild_members_limited¶
Returns
True
if the application is allowed to receive limited guild members information over the gateway.- Type:
- verification_pending_guild_limit¶
Returns
True
if the application is currently pending verification and has hit the guild limit.- Type:
- gateway_message_content¶
Returns
True
if the application is verified and is allowed to receive message content over the gateway.- Type:
- gateway_message_content_limited¶
Returns
True
if the application is verified and is allowed to receive limited message content over the gateway.- Type:
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()
andClient.edit_role_connection_metadata()
.Added in version 2.8.
- type¶
The type of the metadata value.
- description_localizations¶
The localizations for
description
.- Type:
Enumerations¶
TeamMembershipState¶
- class disnake.TeamMembershipState[source]¶
Represents the membership state of a team member retrieved through
Client.application_info()
.Added in version 1.3.
- invited¶
Represents an invited member.
- accepted¶
Represents a member currently in the team.
TeamMemberRole¶
- class disnake.TeamMemberRole[source]¶
Represents the role of a team member retrieved through
Client.application_info()
.Added in version 2.10.
- admin¶
Admins have the most permissions. An admin can only take destructive actions on the team or team-owned apps if they are the team owner.
- developer¶
Developers can access information about a team and team-owned applications, and take limited actions on them, like configuring interaction endpoints or resetting the bot token.
- read_only¶
Read-only members can access information about a team and team-owned applications.
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.
Added 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.
ApplicationEventWebhookStatus¶
- class disnake.ApplicationEventWebhookStatus(value)[source]¶
Represents the status of an application event webhook.
Added in version 2.11.
- disabled¶
Webhook events are disabled by developer.
- enabled¶
Webhook events are enabled by developer.
- disabled_by_discord¶
Webhook events are disabled by Discord, usually due to inactivity.