Skip to content

Commit

Permalink
Update Application Endpoints (#6297)
Browse files Browse the repository at this point in the history
* update application endpoints

* make bot optional

* uh

* add back approximate_guild_count

* aaa

* Update docs/resources/Application.md

Co-authored-by: Lala Sabathil <aiko@aitsys.dev>

* Update docs/resources/Application.md

Co-authored-by: Lala Sabathil <aiko@aitsys.dev>

* TABLES

* tag characters

---------

Co-authored-by: Lala Sabathil <aiko@aitsys.dev>
  • Loading branch information
shaydewael and Lulalaby authored Sep 28, 2023
1 parent 5e916bd commit 0e11b77
Showing 1 changed file with 58 additions and 30 deletions.
88 changes: 58 additions & 30 deletions docs/resources/Application.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,35 @@

###### Application Structure

| Field | Type | Description |
|------------------------------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| id | snowflake | the id of the app |
| name | string | the name of the app |
| icon | ?string | the [icon hash](#DOCS_REFERENCE/image-formatting) of the app |
| description | string | the description of the app |
| rpc_origins? | array of strings | an array of rpc origin urls, if rpc is enabled |
| bot_public | boolean | when false only app owner can join the app's bot to guilds |
| bot_require_code_grant | boolean | when true the app's bot will only join upon completion of the full oauth2 code grant flow |
| terms_of_service_url? | string | the url of the app's terms of service |
| privacy_policy_url? | string | the url of the app's privacy policy |
| owner? | partial [user](#DOCS_RESOURCES_USER/user-object) object | partial user object containing info on the owner of the application |
| summary *(deprecated)* | string | **deprecated and will be removed in v11.** An empty string. |
| verify_key | string | the hex encoded key for verification in interactions and the GameSDK's [GetTicket](#DOCS_GAME_SDK_APPLICATIONS/getticket) |
| team | ?[team](#DOCS_TOPICS_TEAMS/data-models-team-object) object | if the application belongs to a team, this will be a list of the members of that team |
| guild_id? | snowflake | guild associated with the app. For example, a developer support server. |
| guild? | partial [guild](#DOCS_RESOURCES_GUILD/guild-object) object | a partial object of the associated guild |
| primary_sku_id? | snowflake | if this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists |
| slug? | string | if this application is a game sold on Discord, this field will be the URL slug that links to the store page |
| cover_image? | string | the application's default rich presence invite [cover image hash](#DOCS_REFERENCE/image-formatting) |
| flags? | integer | the application's public [flags](#DOCS_RESOURCES_APPLICATION/application-object-application-flags) |
| approximate_guild_count? | integer | an approximate count of the app's guild membership. |
| tags? | array of strings | up to 5 tags describing the content and functionality of the application |
| install_params? | [install params](#DOCS_RESOURCES_APPLICATION/install-params-object) object | settings for the application's default in-app authorization link, if enabled |
| custom_install_url? | string | the application's default custom authorization link, if enabled |
| role_connections_verification_url? | string | 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 |
| Field | Type | Description |
|------------------------------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------|
| id | snowflake | ID of the app |
| name | string | Name of the app |
| icon | ?string | [Icon hash](#DOCS_REFERENCE/image-formatting) of the app |
| description | string | Description of the app |
| rpc_origins? | array of strings | List of RPC origin URLs, if RPC is enabled |
| bot_public | boolean | When `false`, only the app owner can add the app to guilds |
| bot_require_code_grant | boolean | When `true`, the app's bot will only join upon completion of the full OAuth2 code grant flow |
| bot? | partial [user](#DOCS_RESOURCES_USER/user-object) object | Partial user object for the bot user associated with the app |
| terms_of_service_url? | string | URL of the app's Terms of Service |
| privacy_policy_url? | string | URL of the app's Privacy Policy |
| owner? | partial [user](#DOCS_RESOURCES_USER/user-object) object | Partial user object for the owner of the app |
| summary *(deprecated)* | string | **deprecated and will be removed in v11.** An empty string. |
| verify_key | string | Hex encoded key for verification in interactions and the GameSDK's [GetTicket](#DOCS_GAME_SDK_APPLICATIONS/getticket) |
| team | ?[team](#DOCS_TOPICS_TEAMS/data-models-team-object) object | If the app belongs to a team, this will be a list of the members of that team |
| guild_id? | snowflake | Guild associated with the app. For example, a developer support server. |
| guild? | partial [guild](#DOCS_RESOURCES_GUILD/guild-object) object | Partial object of the associated guild |
| primary_sku_id? | 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 |
| slug? | string | If this app is a game sold on Discord, this field will be the URL slug that links to the store page |
| cover_image? | string | App's default rich presence invite [cover image hash](#DOCS_REFERENCE/image-formatting) |
| flags? | integer | App's public [flags](#DOCS_RESOURCES_APPLICATION/application-object-application-flags) |
| approximate_guild_count? | integer | Approximate count of guilds the app has been added to |
| redirect_uris? | array of strings | Array of redirect URIs for the app |
| interactions_endpoint_url? | string | [Interactions endpoint URL](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/receiving-an-interaction) for the app |
| role_connections_verification_url? | string | Role connection verification URL for the app |
| tags? | array of strings | List of tags describing the content and functionality of the app. Max of 5 tags. |
| install_params? | [install params](#DOCS_RESOURCES_APPLICATION/install-params-object) object | Settings for the app's default in-app authorization link, if enabled |
| custom_install_url? | string | Default custom authorization URL for the app, if enabled |

###### Example Application Object

Expand Down Expand Up @@ -93,11 +96,36 @@

###### Install Params Structure

| Field | Type | Description |
|-------------|------------------|------------------------------------------------------------------------------------------------------------|
| scopes | array of strings | the [scopes](#DOCS_TOPICS_OAUTH2/shared-resources-oauth2-scopes) to add the application to the server with |
| permissions | string | the [permissions](#DOCS_TOPICS_PERMISSIONS) to request for the bot role |
| Field | Type | Description |
|-------------|------------------|--------------------------------------------------------------------------------------------------------|
| scopes | array of strings | [Scopes](#DOCS_TOPICS_OAUTH2/shared-resources-oauth2-scopes) to add the application to the server with |
| permissions | string | [Permissions](#DOCS_TOPICS_PERMISSIONS) to request for the bot role |

## Get Current Application % GET /applications/@me

Returns the [application](#DOCS_RESOURCES_APPLICATION/application-object) object associated with the requesting bot user.

## Edit Current Application % PATCH /applications/@me

Edit properties of the app associated with the requesting bot user. Only properties that are passed will be updated. Returns the updated [application](#DOCS_RESOURCES_APPLICATION/application-object) object on success.

> info
> All parameters to this endpoint are optional
###### JSON Params

| Field | Type | Description |
|-----------------------------------|----------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------|
| custom_install_url | string | Default custom authorization URL for the app, if enabled |
| description | string | Description of the app |
| role_connections_verification_url | string | Role connection verification URL for the app |
| install_params | [install params](#DOCS_RESOURCES_APPLICATION/install-params-object) object | Settings for the app's default in-app authorization link, if enabled |
| flags \* | integer | App's public [flags](#DOCS_RESOURCES_APPLICATION/application-object-application-flags) |
| icon | ?[image data](#DOCS_REFERENCE/image-data) | Icon for the app |
| cover_image | ?[image data](#DOCS_REFERENCE/image-data) | Default rich presence invite cover image for the app |
| interactions_endpoint_url \*\* | string | [Interactions endpoint URL](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/receiving-an-interaction) for the app |
| tags | array of strings | List of tags describing the content and functionality of the app (max of 20 characters per tag). Max of 5 tags. |

\* Only limited intent flags (`GATEWAY_PRESENCE_LIMITED`, `GATEWAY_GUILD_MEMBERS_LIMITED`, and `GATEWAY_MESSAGE_CONTENT_LIMITED`) can be updated via the API.

\*\* To update an Interactions endpoint URL via the API, the URL must be valid according to the [Receiving an Interaction](#DOCS_INTERACTIONS_RECEIVING_AND_RESPONDING/receiving-an-interaction) documentation.

0 comments on commit 0e11b77

Please sign in to comment.