Application Info

AppInfo

class discord.AppInfo

Bases: object

Represents the application info for the bot provided by Discord.

id

The application ID.

Type:

int

name

The application name.

Type:

str

owner

The application owner.

Type:

User

team

The application’s team.

Added in version 1.3.

Type:

Optional[Team]

icon

The icon hash, if it exists.

Type:

Optional[str]

description

The application description.

Type:

Optional[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]]

summary

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: This field is deprecated and will be removed in API v11

Added in version 1.3.

Deprecated since version 2.0.

Type:

str

verify_key

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

Added 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.

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]

cover_image

If this application is a game sold on Discord, this field will be the hash of the image on store embeds

Added in version 1.3.

Type:

Optional[str]

custom_install_url

The default invite-url for the bot if its set.

Type:

Optional[str]

install_params

The settings for the application’s default in-app authorization link, if enabled.

Type:

Optional[InstallParams]

privacy_policy_url

The link to this application’s Privacy Policy if set.

Type:

Optional[str]

terms_of_service_url

The link to this application’s Terms of Service if set.

Type:

Optional[str]

interactions_endpoint_url

The endpoint that will receive interactions with this app if its set.

Type:

Optional[str]

property icon_url

Retrieves the application’s icon asset.

This is equivalent to calling icon_url_as() with the default parameters (‘webp’ format and a size of 1024).

Added in version 1.3.

Type:

Asset

icon_url_as(*, format='webp', size=1024)

Returns an Asset for the icon the application has.

The format must be one of ‘webp’, ‘jpeg’, ‘jpg’ or ‘png’. The size must be a power of 2 between 16 and 4096.

Added in version 1.6.

Parameters:
  • format (str) – The format to attempt to convert the icon to. Defaults to ‘webp’.

  • size (int) – The size of the image to display.

Raises:

InvalidArgument – Bad image format passed to format or invalid size.

Returns:

The resulting CDN asset.

Return type:

Asset

property cover_image_url

Retrieves the cover image on a store embed.

This is equivalent to calling cover_image_url_as() with the default parameters (‘webp’ format and a size of 1024).

Added in version 1.3.

Type:

Asset

cover_image_url_as(*, format='webp', size=1024)

Returns an Asset for the image on store embeds if this application is a game sold on Discord.

The format must be one of ‘webp’, ‘jpeg’, ‘jpg’ or ‘png’. The size must be a power of 2 between 16 and 4096.

Added in version 1.6.

Parameters:
  • format (str) – The format to attempt to convert the image to. Defaults to ‘webp’.

  • size (int) – The size of the image to display.

Raises:

InvalidArgument – Bad image format passed to format or invalid size.

Returns:

The resulting CDN asset.

Return type:

Asset

property guild

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

Added in version 1.3.

Type:

Optional[Guild]

Team

class discord.Team

Bases: object

Represents an application team for a bot provided by Discord.

id

The team ID.

Type:

int

name

The team name

Type:

str

icon

The icon hash, if it exists.

Type:

Optional[str]

owner_id

The team’s owner ID.

Type:

int

members

A list of the members in the team

Added in version 1.3.

Type:

List[TeamMember]

property icon_url

Retrieves the team’s icon asset.

This is equivalent to calling icon_url_as() with the default parameters (‘webp’ format and a size of 1024).

Type:

Asset

icon_url_as(*, format='webp', size=1024)

Returns an Asset for the icon the team has.

The format must be one of ‘webp’, ‘jpeg’, ‘jpg’ or ‘png’. The size must be a power of 2 between 16 and 4096.

Added in version 2.0.

Parameters:
  • format (str) – The format to attempt to convert the icon to. Defaults to ‘webp’.

  • size (int) – The size of the image to display.

Raises:

InvalidArgument – Bad image format passed to format or invalid size.

Returns:

The resulting CDN asset.

Return type:

Asset

property owner

The team’s owner.

Type:

Optional[TeamMember]

TeamMember

class discord.TeamMember

Bases: BaseUser

Represents a team member in a team.

Changed in version 2.0: The name attribute was renamed to username due to the (upcoming) username changes.

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 if is_migrated is true, else the user’s name with discriminator.

Note

When the migration is complete, this will always return the username.

Added in version 1.3.

username

The team member’s username.

Type:

str

global_name

The team members global_name if any.

Type:

Optional[str]

id

The team member’s unique ID.

Type:

int

discriminator

The team member’s discriminator.

Important

This will be removed in a future API version. Read more about it here.

Type:

str

avatar

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

role

The role of the team member.

Added in version 2.0.

Type:

TeamRole