Skip to content

Commit 17f42e0

Browse files
authored
feat: Application patch and new properties (#810)
* feat: application patch and properties * docs(APIApplication): update tag documentation * fix(RESTPatchCurrentApplicationJSONBody): add `flags` * docs(APIApplication): update `approximate_guild_count`
1 parent 5515e29 commit 17f42e0

File tree

12 files changed

+188
-46
lines changed

12 files changed

+188
-46
lines changed

deno/payloads/v10/application.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export interface APIApplication {
4141
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
4242
*/
4343
bot_require_code_grant: boolean;
44+
/**
45+
* Partial user object for the bot user associated with the application
46+
*/
47+
bot?: APIUser;
4448
/**
4549
* The url of the application's terms of service
4650
*/
@@ -60,7 +64,7 @@ export interface APIApplication {
6064
*
6165
* @deprecated This field will be removed in v11
6266
*/
63-
summary: string;
67+
summary: '';
6468
/**
6569
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
6670
*
@@ -77,6 +81,10 @@ export interface APIApplication {
7781
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
7882
*/
7983
guild_id?: Snowflake;
84+
/**
85+
* A partial object of the associated guild
86+
*/
87+
guild?: APIPartialGuild;
8088
/**
8189
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
8290
*/
@@ -96,30 +104,34 @@ export interface APIApplication {
96104
*/
97105
flags: ApplicationFlags;
98106
/**
99-
* Up to 5 tags describing the content and functionality of the application
107+
* Approximate count of guilds the application has been added to
100108
*/
101-
tags?: [string, string?, string?, string?, string?];
109+
approximate_guild_count?: number;
102110
/**
103-
* Settings for the application's default in-app authorization link, if enabled
111+
* Array of redirect URIs for the application
104112
*/
105-
install_params?: APIApplicationInstallParams;
113+
redirect_uris?: string[];
106114
/**
107-
* The application's default custom authorization link, if enabled
115+
* The interactions endpoint URL for the application
108116
*/
109-
custom_install_url?: string;
117+
interactions_endpoint_url?: string;
110118
/**
111119
* The application's role connection verification entry point,
112120
* which when configured will render the app as a verification method in the guild role verification configuration
113121
*/
114122
role_connections_verification_url?: string;
115123
/**
116-
* An approximate count of the app's guild membership
124+
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
117125
*/
118-
approximate_guild_count?: number;
126+
tags?: [string, string?, string?, string?, string?];
119127
/**
120-
* A partial object of the associated guild
128+
* Settings for the application's default in-app authorization link, if enabled
121129
*/
122-
guild?: APIPartialGuild;
130+
install_params?: APIApplicationInstallParams;
131+
/**
132+
* The application's default custom authorization link, if enabled
133+
*/
134+
custom_install_url?: string;
123135
}
124136

125137
export interface APIApplicationInstallParams {

deno/payloads/v9/application.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export interface APIApplication {
4141
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
4242
*/
4343
bot_require_code_grant: boolean;
44+
/**
45+
* Partial user object for the bot user associated with the application
46+
*/
47+
bot?: APIUser;
4448
/**
4549
* The url of the application's terms of service
4650
*/
@@ -60,7 +64,7 @@ export interface APIApplication {
6064
*
6165
* @deprecated This field will be removed in v11
6266
*/
63-
summary: string;
67+
summary: '';
6468
/**
6569
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
6670
*
@@ -77,6 +81,10 @@ export interface APIApplication {
7781
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
7882
*/
7983
guild_id?: Snowflake;
84+
/**
85+
* A partial object of the associated guild
86+
*/
87+
guild?: APIPartialGuild;
8088
/**
8189
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
8290
*/
@@ -96,31 +104,34 @@ export interface APIApplication {
96104
*/
97105
flags: ApplicationFlags;
98106
/**
99-
* Up to 5 tags describing the content and functionality of the application
107+
* Approximate count of guilds the application has been added to
100108
*/
101-
tags?: [string, string?, string?, string?, string?];
109+
approximate_guild_count?: number;
102110
/**
103-
* Settings for the application's default in-app authorization link, if enabled
111+
* Array of redirect URIs for the application
104112
*/
105-
install_params?: APIApplicationInstallParams;
113+
redirect_uris?: string[];
106114
/**
107-
* The application's default custom authorization link, if enabled
115+
* The interactions endpoint URL for the application
108116
*/
109-
custom_install_url?: string;
117+
interactions_endpoint_url?: string;
110118
/**
111119
* The application's role connection verification entry point,
112120
* which when configured will render the app as a verification method in the guild role verification configuration
113121
*/
114122
role_connections_verification_url?: string;
115123
/**
116-
* An approximate count of the app's guild membership
117-
* s
124+
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
118125
*/
119-
approximate_guild_count?: number;
126+
tags?: [string, string?, string?, string?, string?];
120127
/**
121-
* A partial object of the associated guild
128+
* Settings for the application's default in-app authorization link, if enabled
122129
*/
123-
guild?: APIPartialGuild;
130+
install_params?: APIApplicationInstallParams;
131+
/**
132+
* The application's default custom authorization link, if enabled
133+
*/
134+
custom_install_url?: string;
124135
}
125136

126137
export interface APIApplicationInstallParams {

deno/rest/v10/application.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v10/application.ts';
2+
import type { Nullable, StrictPartial } from '../../utils/internals.ts';
23

34
/**
45
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
@@ -19,3 +20,25 @@ export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRo
1920
* https://discord.com/developers/docs/resources/application#get-current-application
2021
*/
2122
export type RESTGetCurrentApplicationResult = APIApplication;
23+
24+
/**
25+
* https://discord.com/developers/docs/resources/application#edit-current-application
26+
*/
27+
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
28+
Pick<
29+
APIApplication,
30+
| 'custom_install_url'
31+
| 'description'
32+
| 'flags'
33+
| 'role_connections_verification_url'
34+
| 'install_params'
35+
| 'interactions_endpoint_url'
36+
| 'tags'
37+
> &
38+
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
39+
>;
40+
41+
/**
42+
* https://discord.com/developers/docs/resources/application#edit-current-application
43+
*/
44+
export type RESTPatchCurrentApplicationResult = APIApplication;

deno/rest/v10/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -902,6 +902,7 @@ export const Routes = {
902902
/**
903903
* Route for:
904904
* - GET `/applications/@me`
905+
* - PATCH `/applications/@me`
905906
*/
906907
currentApplication() {
907908
return '/applications/@me' as const;

deno/rest/v9/application.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { APIApplication, APIApplicationRoleConnectionMetadata } from '../../payloads/v9/application.ts';
2+
import type { StrictPartial, Nullable } from '../../utils/internals.ts';
23

34
/**
45
* https://discord.com/developers/docs/resources/application-role-connection-metadata#get-application-role-connection-metadata-records
@@ -19,3 +20,25 @@ export type RESTPutAPIApplicationRoleConnectionMetadataResult = APIApplicationRo
1920
* https://discord.com/developers/docs/resources/application#get-current-application
2021
*/
2122
export type RESTGetCurrentApplicationResult = APIApplication;
23+
24+
/**
25+
* https://discord.com/developers/docs/resources/application#edit-current-application
26+
*/
27+
export type RESTPatchCurrentApplicationJSONBody = StrictPartial<
28+
Pick<
29+
APIApplication,
30+
| 'custom_install_url'
31+
| 'description'
32+
| 'flags'
33+
| 'role_connections_verification_url'
34+
| 'install_params'
35+
| 'interactions_endpoint_url'
36+
| 'tags'
37+
> &
38+
Nullable<Pick<APIApplication, 'icon' | 'cover_image'>>
39+
>;
40+
41+
/**
42+
* https://discord.com/developers/docs/resources/application#edit-current-application
43+
*/
44+
export type RESTPatchCurrentApplicationResult = APIApplication;

deno/rest/v9/mod.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -911,6 +911,7 @@ export const Routes = {
911911
/**
912912
* Route for:
913913
* - GET `/applications/@me`
914+
* - PATCH `/applications/@me`
914915
*/
915916
currentApplication() {
916917
return '/applications/@me' as const;

payloads/v10/application.ts

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export interface APIApplication {
4141
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
4242
*/
4343
bot_require_code_grant: boolean;
44+
/**
45+
* Partial user object for the bot user associated with the application
46+
*/
47+
bot?: APIUser;
4448
/**
4549
* The url of the application's terms of service
4650
*/
@@ -60,7 +64,7 @@ export interface APIApplication {
6064
*
6165
* @deprecated This field will be removed in v11
6266
*/
63-
summary: string;
67+
summary: '';
6468
/**
6569
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
6670
*
@@ -77,6 +81,10 @@ export interface APIApplication {
7781
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
7882
*/
7983
guild_id?: Snowflake;
84+
/**
85+
* A partial object of the associated guild
86+
*/
87+
guild?: APIPartialGuild;
8088
/**
8189
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
8290
*/
@@ -96,30 +104,34 @@ export interface APIApplication {
96104
*/
97105
flags: ApplicationFlags;
98106
/**
99-
* Up to 5 tags describing the content and functionality of the application
107+
* Approximate count of guilds the application has been added to
100108
*/
101-
tags?: [string, string?, string?, string?, string?];
109+
approximate_guild_count?: number;
102110
/**
103-
* Settings for the application's default in-app authorization link, if enabled
111+
* Array of redirect URIs for the application
104112
*/
105-
install_params?: APIApplicationInstallParams;
113+
redirect_uris?: string[];
106114
/**
107-
* The application's default custom authorization link, if enabled
115+
* The interactions endpoint URL for the application
108116
*/
109-
custom_install_url?: string;
117+
interactions_endpoint_url?: string;
110118
/**
111119
* The application's role connection verification entry point,
112120
* which when configured will render the app as a verification method in the guild role verification configuration
113121
*/
114122
role_connections_verification_url?: string;
115123
/**
116-
* An approximate count of the app's guild membership
124+
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
117125
*/
118-
approximate_guild_count?: number;
126+
tags?: [string, string?, string?, string?, string?];
119127
/**
120-
* A partial object of the associated guild
128+
* Settings for the application's default in-app authorization link, if enabled
121129
*/
122-
guild?: APIPartialGuild;
130+
install_params?: APIApplicationInstallParams;
131+
/**
132+
* The application's default custom authorization link, if enabled
133+
*/
134+
custom_install_url?: string;
123135
}
124136

125137
export interface APIApplicationInstallParams {

payloads/v9/application.ts

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ export interface APIApplication {
4141
* When `true` the app's bot will only join upon completion of the full oauth2 code grant flow
4242
*/
4343
bot_require_code_grant: boolean;
44+
/**
45+
* Partial user object for the bot user associated with the application
46+
*/
47+
bot?: APIUser;
4448
/**
4549
* The url of the application's terms of service
4650
*/
@@ -60,7 +64,7 @@ export interface APIApplication {
6064
*
6165
* @deprecated This field will be removed in v11
6266
*/
63-
summary: string;
67+
summary: '';
6468
/**
6569
* The hexadecimal encoded key for verification in interactions and the GameSDK's GetTicket function
6670
*
@@ -77,6 +81,10 @@ export interface APIApplication {
7781
* If this application is a game sold on Discord, this field will be the guild to which it has been linked
7882
*/
7983
guild_id?: Snowflake;
84+
/**
85+
* A partial object of the associated guild
86+
*/
87+
guild?: APIPartialGuild;
8088
/**
8189
* If this application is a game sold on Discord, this field will be the id of the "Game SKU" that is created, if exists
8290
*/
@@ -96,31 +104,34 @@ export interface APIApplication {
96104
*/
97105
flags: ApplicationFlags;
98106
/**
99-
* Up to 5 tags describing the content and functionality of the application
107+
* Approximate count of guilds the application has been added to
100108
*/
101-
tags?: [string, string?, string?, string?, string?];
109+
approximate_guild_count?: number;
102110
/**
103-
* Settings for the application's default in-app authorization link, if enabled
111+
* Array of redirect URIs for the application
104112
*/
105-
install_params?: APIApplicationInstallParams;
113+
redirect_uris?: string[];
106114
/**
107-
* The application's default custom authorization link, if enabled
115+
* The interactions endpoint URL for the application
108116
*/
109-
custom_install_url?: string;
117+
interactions_endpoint_url?: string;
110118
/**
111119
* The application's role connection verification entry point,
112120
* which when configured will render the app as a verification method in the guild role verification configuration
113121
*/
114122
role_connections_verification_url?: string;
115123
/**
116-
* An approximate count of the app's guild membership
117-
* s
124+
* Up to 5 tags of max 20 characters each describing the content and functionality of the application
118125
*/
119-
approximate_guild_count?: number;
126+
tags?: [string, string?, string?, string?, string?];
120127
/**
121-
* A partial object of the associated guild
128+
* Settings for the application's default in-app authorization link, if enabled
122129
*/
123-
guild?: APIPartialGuild;
130+
install_params?: APIApplicationInstallParams;
131+
/**
132+
* The application's default custom authorization link, if enabled
133+
*/
134+
custom_install_url?: string;
124135
}
125136

126137
export interface APIApplicationInstallParams {

0 commit comments

Comments
 (0)