@discordjs/core 3.0.0-dev.1795176133-cd7400323 → 3.0.0-dev.1795392139-33799ee19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/applicationCommands.d.ts +17 -16
- package/dist/api/applicationCommands.d.ts.map +1 -1
- package/dist/api/applicationCommands.js +33 -53
- package/dist/api/applicationCommands.js.map +1 -1
- package/dist/api/applications.d.ts +10 -9
- package/dist/api/applications.d.ts.map +1 -1
- package/dist/api/applications.js +16 -28
- package/dist/api/applications.js.map +1 -1
- package/dist/api/channel.d.ts +36 -35
- package/dist/api/channel.d.ts.map +1 -1
- package/dist/api/channel.js +71 -119
- package/dist/api/channel.js.map +1 -1
- package/dist/api/gateway.d.ts +4 -3
- package/dist/api/gateway.d.ts.map +1 -1
- package/dist/api/gateway.js +4 -7
- package/dist/api/gateway.js.map +1 -1
- package/dist/api/guild.d.ts +80 -79
- package/dist/api/guild.d.ts.map +1 -1
- package/dist/api/guild.js +162 -252
- package/dist/api/guild.js.map +1 -1
- package/dist/api/interactions.d.ts +27 -26
- package/dist/api/interactions.d.ts.map +1 -1
- package/dist/api/interactions.js +22 -24
- package/dist/api/interactions.js.map +1 -1
- package/dist/api/invite.d.ts +7 -6
- package/dist/api/invite.d.ts.map +1 -1
- package/dist/api/invite.js +10 -18
- package/dist/api/invite.js.map +1 -1
- package/dist/api/monetization.d.ts +10 -9
- package/dist/api/monetization.d.ts.map +1 -1
- package/dist/api/monetization.js +16 -25
- package/dist/api/monetization.js.map +1 -1
- package/dist/api/oauth2.d.ts +8 -7
- package/dist/api/oauth2.d.ts.map +1 -1
- package/dist/api/oauth2.js +16 -18
- package/dist/api/oauth2.js.map +1 -1
- package/dist/api/poll.d.ts +4 -3
- package/dist/api/poll.d.ts.map +1 -1
- package/dist/api/poll.js +4 -8
- package/dist/api/poll.js.map +1 -1
- package/dist/api/roleConnections.d.ts +4 -3
- package/dist/api/roleConnections.d.ts.map +1 -1
- package/dist/api/roleConnections.js +4 -8
- package/dist/api/roleConnections.js.map +1 -1
- package/dist/api/soundboardSounds.d.ts +3 -2
- package/dist/api/soundboardSounds.d.ts.map +1 -1
- package/dist/api/soundboardSounds.js +2 -5
- package/dist/api/soundboardSounds.js.map +1 -1
- package/dist/api/stageInstances.d.ts +6 -5
- package/dist/api/stageInstances.d.ts.map +1 -1
- package/dist/api/stageInstances.js +8 -12
- package/dist/api/stageInstances.js.map +1 -1
- package/dist/api/sticker.d.ts +5 -4
- package/dist/api/sticker.d.ts.map +1 -1
- package/dist/api/sticker.js +6 -6
- package/dist/api/sticker.js.map +1 -1
- package/dist/api/thread.d.ts +9 -8
- package/dist/api/thread.d.ts.map +1 -1
- package/dist/api/thread.js +12 -14
- package/dist/api/thread.js.map +1 -1
- package/dist/api/user.d.ts +14 -13
- package/dist/api/user.d.ts.map +1 -1
- package/dist/api/user.js +27 -38
- package/dist/api/user.js.map +1 -1
- package/dist/api/voice.d.ts +7 -6
- package/dist/api/voice.d.ts.map +1 -1
- package/dist/api/voice.js +10 -19
- package/dist/api/voice.js.map +1 -1
- package/dist/api/webhook.d.ts +12 -11
- package/dist/api/webhook.d.ts.map +1 -1
- package/dist/api/webhook.js +18 -20
- package/dist/api/webhook.js.map +1 -1
- package/dist/http-only/index.js +1 -1
- package/dist/index.js +1 -1
- package/dist/util/index.d.ts +1 -0
- package/dist/util/index.d.ts.map +1 -1
- package/dist/util/types.d.ts +23 -0
- package/dist/util/types.d.ts.map +1 -0
- package/dist/util/types.js +2 -0
- package/dist/util/types.js.map +1 -0
- package/package.json +4 -4
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type REST } from '@discordjs/rest';
|
|
2
2
|
import { type Locale, type RESTGetAPIApplicationCommandsQuery, type RESTGetAPIApplicationCommandsResult, type RESTGetAPIApplicationGuildCommandResult, type RESTGetAPIApplicationGuildCommandsQuery, type RESTGetAPIApplicationGuildCommandsResult, type RESTGetAPIGuildApplicationCommandsPermissionsResult, type RESTPatchAPIApplicationCommandJSONBody, type RESTPatchAPIApplicationGuildCommandJSONBody, type RESTPatchAPIApplicationGuildCommandResult, type RESTPostAPIApplicationCommandsJSONBody, type RESTPostAPIApplicationGuildCommandsJSONBody, type RESTPostAPIApplicationGuildCommandsResult, type RESTPutAPIApplicationCommandPermissionsJSONBody, type RESTPutAPIApplicationCommandsJSONBody, type RESTPutAPIApplicationCommandsResult, type RESTPutAPIApplicationGuildCommandsJSONBody, type RESTPutAPIApplicationGuildCommandsResult, type Snowflake } from 'discord-api-types/v10';
|
|
3
|
+
import type { BaseRequestOptions, RequestOptions } from '../util/types.js';
|
|
3
4
|
export declare class ApplicationCommandsAPI {
|
|
4
5
|
private readonly rest;
|
|
5
6
|
constructor(rest: REST);
|
|
@@ -11,7 +12,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
11
12
|
* @param query - The query options for fetching commands
|
|
12
13
|
* @param options - The options for fetching commands
|
|
13
14
|
*/
|
|
14
|
-
getGlobalCommands(applicationId: Snowflake, query?: RESTGetAPIApplicationCommandsQuery, {
|
|
15
|
+
getGlobalCommands(applicationId: Snowflake, query?: RESTGetAPIApplicationCommandsQuery, { headers, locale, ...options }?: RequestOptions & {
|
|
15
16
|
locale?: Locale;
|
|
16
17
|
}): Promise<RESTGetAPIApplicationCommandsResult>;
|
|
17
18
|
/**
|
|
@@ -22,7 +23,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
22
23
|
* @param body - The data for creating the command
|
|
23
24
|
* @param options - The options for creating the command
|
|
24
25
|
*/
|
|
25
|
-
createGlobalCommand(applicationId: Snowflake, body: RESTPostAPIApplicationCommandsJSONBody,
|
|
26
|
+
createGlobalCommand(applicationId: Snowflake, body: RESTPostAPIApplicationCommandsJSONBody, options?: RequestOptions): Promise<import("discord-api-types/v10").APIApplicationCommand>;
|
|
26
27
|
/**
|
|
27
28
|
* Fetches a global command
|
|
28
29
|
*
|
|
@@ -31,7 +32,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
31
32
|
* @param commandId - The command id to fetch
|
|
32
33
|
* @param options - The options for fetching the command
|
|
33
34
|
*/
|
|
34
|
-
getGlobalCommand(applicationId: Snowflake, commandId: Snowflake,
|
|
35
|
+
getGlobalCommand(applicationId: Snowflake, commandId: Snowflake, options?: RequestOptions): Promise<import("discord-api-types/v10").APIApplicationCommand>;
|
|
35
36
|
/**
|
|
36
37
|
* Edits a global command
|
|
37
38
|
*
|
|
@@ -41,7 +42,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
41
42
|
* @param body - The data for editing the command
|
|
42
43
|
* @param options - The options for editing the command
|
|
43
44
|
*/
|
|
44
|
-
editGlobalCommand(applicationId: Snowflake, commandId: Snowflake, body: RESTPatchAPIApplicationCommandJSONBody,
|
|
45
|
+
editGlobalCommand(applicationId: Snowflake, commandId: Snowflake, body: RESTPatchAPIApplicationCommandJSONBody, options?: RequestOptions): Promise<import("discord-api-types/v10").APIApplicationCommand>;
|
|
45
46
|
/**
|
|
46
47
|
* Deletes a global command
|
|
47
48
|
*
|
|
@@ -50,7 +51,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
50
51
|
* @param commandId - The id of the command to delete
|
|
51
52
|
* @param options - The options for deleting a command
|
|
52
53
|
*/
|
|
53
|
-
deleteGlobalCommand(applicationId: Snowflake, commandId: Snowflake,
|
|
54
|
+
deleteGlobalCommand(applicationId: Snowflake, commandId: Snowflake, options?: RequestOptions): Promise<void>;
|
|
54
55
|
/**
|
|
55
56
|
* Overwrites global commands
|
|
56
57
|
*
|
|
@@ -59,7 +60,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
59
60
|
* @param body - The data for overwriting commands
|
|
60
61
|
* @param options - The options for overwriting commands
|
|
61
62
|
*/
|
|
62
|
-
bulkOverwriteGlobalCommands(applicationId: Snowflake, body: RESTPutAPIApplicationCommandsJSONBody,
|
|
63
|
+
bulkOverwriteGlobalCommands(applicationId: Snowflake, body: RESTPutAPIApplicationCommandsJSONBody, options?: RequestOptions): Promise<RESTPutAPIApplicationCommandsResult>;
|
|
63
64
|
/**
|
|
64
65
|
* Fetches all commands for a guild
|
|
65
66
|
*
|
|
@@ -69,7 +70,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
69
70
|
* @param query - The data for fetching commands
|
|
70
71
|
* @param options - The options for fetching commands
|
|
71
72
|
*/
|
|
72
|
-
getGuildCommands(applicationId: Snowflake, guildId: Snowflake, query?: RESTGetAPIApplicationGuildCommandsQuery, {
|
|
73
|
+
getGuildCommands(applicationId: Snowflake, guildId: Snowflake, query?: RESTGetAPIApplicationGuildCommandsQuery, { headers, locale, ...options }?: RequestOptions & {
|
|
73
74
|
locale?: Locale;
|
|
74
75
|
}): Promise<RESTGetAPIApplicationGuildCommandsResult>;
|
|
75
76
|
/**
|
|
@@ -81,7 +82,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
81
82
|
* @param body - The data for creating the command
|
|
82
83
|
* @param options - The options for creating the command
|
|
83
84
|
*/
|
|
84
|
-
createGuildCommand(applicationId: Snowflake, guildId: Snowflake, body: RESTPostAPIApplicationGuildCommandsJSONBody,
|
|
85
|
+
createGuildCommand(applicationId: Snowflake, guildId: Snowflake, body: RESTPostAPIApplicationGuildCommandsJSONBody, options?: RequestOptions): Promise<RESTPostAPIApplicationGuildCommandsResult>;
|
|
85
86
|
/**
|
|
86
87
|
* Fetches a guild command
|
|
87
88
|
*
|
|
@@ -91,7 +92,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
91
92
|
* @param commandId - The command id to fetch
|
|
92
93
|
* @param options - The options for fetching the command
|
|
93
94
|
*/
|
|
94
|
-
getGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake,
|
|
95
|
+
getGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, options?: RequestOptions): Promise<RESTGetAPIApplicationGuildCommandResult>;
|
|
95
96
|
/**
|
|
96
97
|
* Edits a guild command
|
|
97
98
|
*
|
|
@@ -102,7 +103,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
102
103
|
* @param body - The data for editing the command
|
|
103
104
|
* @param options - The options for editing the command
|
|
104
105
|
*/
|
|
105
|
-
editGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, body: RESTPatchAPIApplicationGuildCommandJSONBody,
|
|
106
|
+
editGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, body: RESTPatchAPIApplicationGuildCommandJSONBody, options?: RequestOptions): Promise<RESTPatchAPIApplicationGuildCommandResult>;
|
|
106
107
|
/**
|
|
107
108
|
* Deletes a guild command
|
|
108
109
|
*
|
|
@@ -112,7 +113,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
112
113
|
* @param commandId - The id of the command to delete
|
|
113
114
|
* @param options - The options for deleting the command
|
|
114
115
|
*/
|
|
115
|
-
deleteGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake,
|
|
116
|
+
deleteGuildCommand(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, options?: RequestOptions): Promise<void>;
|
|
116
117
|
/**
|
|
117
118
|
* Bulk overwrites guild commands
|
|
118
119
|
*
|
|
@@ -122,7 +123,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
122
123
|
* @param body - The data for overwriting commands
|
|
123
124
|
* @param options - The options for overwriting the commands
|
|
124
125
|
*/
|
|
125
|
-
bulkOverwriteGuildCommands(applicationId: Snowflake, guildId: Snowflake, body: RESTPutAPIApplicationGuildCommandsJSONBody,
|
|
126
|
+
bulkOverwriteGuildCommands(applicationId: Snowflake, guildId: Snowflake, body: RESTPutAPIApplicationGuildCommandsJSONBody, options?: RequestOptions): Promise<RESTPutAPIApplicationGuildCommandsResult>;
|
|
126
127
|
/**
|
|
127
128
|
* Fetches the permissions for a guild command
|
|
128
129
|
*
|
|
@@ -132,7 +133,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
132
133
|
* @param commandId - The command id to get the permissions for
|
|
133
134
|
* @param options - The option for fetching the command
|
|
134
135
|
*/
|
|
135
|
-
getGuildCommandPermissions(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake,
|
|
136
|
+
getGuildCommandPermissions(applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, options?: RequestOptions): Promise<import("discord-api-types/v10").APIGuildApplicationCommandPermissions>;
|
|
136
137
|
/**
|
|
137
138
|
* Fetches all permissions for all commands in a guild
|
|
138
139
|
*
|
|
@@ -141,7 +142,7 @@ export declare class ApplicationCommandsAPI {
|
|
|
141
142
|
* @param guildId - The guild id to get the permissions for
|
|
142
143
|
* @param options - The options for fetching permissions
|
|
143
144
|
*/
|
|
144
|
-
getGuildCommandsPermissions(applicationId: Snowflake, guildId: Snowflake,
|
|
145
|
+
getGuildCommandsPermissions(applicationId: Snowflake, guildId: Snowflake, options?: RequestOptions): Promise<RESTGetAPIGuildApplicationCommandsPermissionsResult>;
|
|
145
146
|
/**
|
|
146
147
|
* Edits the permissions for a guild command
|
|
147
148
|
*
|
|
@@ -153,6 +154,6 @@ export declare class ApplicationCommandsAPI {
|
|
|
153
154
|
* @param body - The data for editing the permissions
|
|
154
155
|
* @param options - The options for editing the permissions
|
|
155
156
|
*/
|
|
156
|
-
editGuildCommandPermissions(userToken: string, applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, body: RESTPutAPIApplicationCommandPermissionsJSONBody, {
|
|
157
|
+
editGuildCommandPermissions(userToken: string, applicationId: Snowflake, guildId: Snowflake, commandId: Snowflake, body: RESTPutAPIApplicationCommandPermissionsJSONBody, { headers, ...options }?: BaseRequestOptions): Promise<import("discord-api-types/v10").APIGuildApplicationCommandPermissions>;
|
|
157
158
|
}
|
|
158
159
|
//# sourceMappingURL=applicationCommands.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicationCommands.d.ts","sourceRoot":"","sources":["../../src/api/applicationCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,KAAK,
|
|
1
|
+
{"version":3,"file":"applicationCommands.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GAAE,cAAmB,qDAM5B;IAED;;;;;;;;OAQG;IACU,0BAA0B,CACtC,aAAa,EAAE,SAAS,EACxB,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS,EACpB,OAAO,GAAE,cAAmB,kFAM5B;IAED;;;;;;;OAOG;IACU,2BAA2B,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAE,cAAmB,gEAKlH;IAED;;;;;;;;;;OAUG;IACU,2BAA2B,CACvC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,SAAS,EACxB,OAAO,EAAE,SAAS,EAClB,SAAS,EAAE,SAAS,EACpB,IAAI,EAAE,+CAA+C,EACrD,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAE,kBAAuB,kFAQhD;CACD"}
|
|
@@ -13,12 +13,11 @@ export class ApplicationCommandsAPI {
|
|
|
13
13
|
* @param query - The query options for fetching commands
|
|
14
14
|
* @param options - The options for fetching commands
|
|
15
15
|
*/
|
|
16
|
-
async getGlobalCommands(applicationId, query = {}, {
|
|
16
|
+
async getGlobalCommands(applicationId, query = {}, { headers, locale, ...options } = {}) {
|
|
17
17
|
return this.rest.get(Routes.applicationCommands(applicationId), {
|
|
18
|
-
|
|
19
|
-
headers: locale ? { 'X-Discord-Locale': locale } :
|
|
18
|
+
...options,
|
|
19
|
+
headers: locale ? { ...headers, 'X-Discord-Locale': locale } : headers,
|
|
20
20
|
query: makeURLSearchParams(query),
|
|
21
|
-
signal,
|
|
22
21
|
});
|
|
23
22
|
}
|
|
24
23
|
/**
|
|
@@ -29,11 +28,10 @@ export class ApplicationCommandsAPI {
|
|
|
29
28
|
* @param body - The data for creating the command
|
|
30
29
|
* @param options - The options for creating the command
|
|
31
30
|
*/
|
|
32
|
-
async createGlobalCommand(applicationId, body,
|
|
31
|
+
async createGlobalCommand(applicationId, body, options = {}) {
|
|
33
32
|
return this.rest.post(Routes.applicationCommands(applicationId), {
|
|
34
|
-
|
|
33
|
+
...options,
|
|
35
34
|
body,
|
|
36
|
-
signal,
|
|
37
35
|
});
|
|
38
36
|
}
|
|
39
37
|
/**
|
|
@@ -44,11 +42,8 @@ export class ApplicationCommandsAPI {
|
|
|
44
42
|
* @param commandId - The command id to fetch
|
|
45
43
|
* @param options - The options for fetching the command
|
|
46
44
|
*/
|
|
47
|
-
async getGlobalCommand(applicationId, commandId,
|
|
48
|
-
return this.rest.get(Routes.applicationCommand(applicationId, commandId),
|
|
49
|
-
auth,
|
|
50
|
-
signal,
|
|
51
|
-
});
|
|
45
|
+
async getGlobalCommand(applicationId, commandId, options = {}) {
|
|
46
|
+
return this.rest.get(Routes.applicationCommand(applicationId, commandId), options);
|
|
52
47
|
}
|
|
53
48
|
/**
|
|
54
49
|
* Edits a global command
|
|
@@ -59,11 +54,10 @@ export class ApplicationCommandsAPI {
|
|
|
59
54
|
* @param body - The data for editing the command
|
|
60
55
|
* @param options - The options for editing the command
|
|
61
56
|
*/
|
|
62
|
-
async editGlobalCommand(applicationId, commandId, body,
|
|
57
|
+
async editGlobalCommand(applicationId, commandId, body, options = {}) {
|
|
63
58
|
return this.rest.patch(Routes.applicationCommand(applicationId, commandId), {
|
|
64
|
-
|
|
59
|
+
...options,
|
|
65
60
|
body,
|
|
66
|
-
signal,
|
|
67
61
|
});
|
|
68
62
|
}
|
|
69
63
|
/**
|
|
@@ -74,8 +68,8 @@ export class ApplicationCommandsAPI {
|
|
|
74
68
|
* @param commandId - The id of the command to delete
|
|
75
69
|
* @param options - The options for deleting a command
|
|
76
70
|
*/
|
|
77
|
-
async deleteGlobalCommand(applicationId, commandId,
|
|
78
|
-
await this.rest.delete(Routes.applicationCommand(applicationId, commandId),
|
|
71
|
+
async deleteGlobalCommand(applicationId, commandId, options = {}) {
|
|
72
|
+
await this.rest.delete(Routes.applicationCommand(applicationId, commandId), options);
|
|
79
73
|
}
|
|
80
74
|
/**
|
|
81
75
|
* Overwrites global commands
|
|
@@ -85,11 +79,10 @@ export class ApplicationCommandsAPI {
|
|
|
85
79
|
* @param body - The data for overwriting commands
|
|
86
80
|
* @param options - The options for overwriting commands
|
|
87
81
|
*/
|
|
88
|
-
async bulkOverwriteGlobalCommands(applicationId, body,
|
|
82
|
+
async bulkOverwriteGlobalCommands(applicationId, body, options = {}) {
|
|
89
83
|
return this.rest.put(Routes.applicationCommands(applicationId), {
|
|
90
|
-
|
|
84
|
+
...options,
|
|
91
85
|
body,
|
|
92
|
-
signal,
|
|
93
86
|
});
|
|
94
87
|
}
|
|
95
88
|
/**
|
|
@@ -101,12 +94,11 @@ export class ApplicationCommandsAPI {
|
|
|
101
94
|
* @param query - The data for fetching commands
|
|
102
95
|
* @param options - The options for fetching commands
|
|
103
96
|
*/
|
|
104
|
-
async getGuildCommands(applicationId, guildId, query = {}, {
|
|
97
|
+
async getGuildCommands(applicationId, guildId, query = {}, { headers, locale, ...options } = {}) {
|
|
105
98
|
return this.rest.get(Routes.applicationGuildCommands(applicationId, guildId), {
|
|
106
|
-
|
|
107
|
-
headers: locale ? { 'X-Discord-Locale': locale } :
|
|
99
|
+
...options,
|
|
100
|
+
headers: locale ? { ...headers, 'X-Discord-Locale': locale } : headers,
|
|
108
101
|
query: makeURLSearchParams(query),
|
|
109
|
-
signal,
|
|
110
102
|
});
|
|
111
103
|
}
|
|
112
104
|
/**
|
|
@@ -118,11 +110,10 @@ export class ApplicationCommandsAPI {
|
|
|
118
110
|
* @param body - The data for creating the command
|
|
119
111
|
* @param options - The options for creating the command
|
|
120
112
|
*/
|
|
121
|
-
async createGuildCommand(applicationId, guildId, body,
|
|
113
|
+
async createGuildCommand(applicationId, guildId, body, options = {}) {
|
|
122
114
|
return this.rest.post(Routes.applicationGuildCommands(applicationId, guildId), {
|
|
123
|
-
|
|
115
|
+
...options,
|
|
124
116
|
body,
|
|
125
|
-
signal,
|
|
126
117
|
});
|
|
127
118
|
}
|
|
128
119
|
/**
|
|
@@ -134,11 +125,8 @@ export class ApplicationCommandsAPI {
|
|
|
134
125
|
* @param commandId - The command id to fetch
|
|
135
126
|
* @param options - The options for fetching the command
|
|
136
127
|
*/
|
|
137
|
-
async getGuildCommand(applicationId, guildId, commandId,
|
|
138
|
-
return this.rest.get(Routes.applicationGuildCommand(applicationId, guildId, commandId),
|
|
139
|
-
auth,
|
|
140
|
-
signal,
|
|
141
|
-
});
|
|
128
|
+
async getGuildCommand(applicationId, guildId, commandId, options = {}) {
|
|
129
|
+
return this.rest.get(Routes.applicationGuildCommand(applicationId, guildId, commandId), options);
|
|
142
130
|
}
|
|
143
131
|
/**
|
|
144
132
|
* Edits a guild command
|
|
@@ -150,11 +138,10 @@ export class ApplicationCommandsAPI {
|
|
|
150
138
|
* @param body - The data for editing the command
|
|
151
139
|
* @param options - The options for editing the command
|
|
152
140
|
*/
|
|
153
|
-
async editGuildCommand(applicationId, guildId, commandId, body,
|
|
141
|
+
async editGuildCommand(applicationId, guildId, commandId, body, options = {}) {
|
|
154
142
|
return this.rest.patch(Routes.applicationGuildCommand(applicationId, guildId, commandId), {
|
|
155
|
-
|
|
143
|
+
...options,
|
|
156
144
|
body,
|
|
157
|
-
signal,
|
|
158
145
|
});
|
|
159
146
|
}
|
|
160
147
|
/**
|
|
@@ -166,8 +153,8 @@ export class ApplicationCommandsAPI {
|
|
|
166
153
|
* @param commandId - The id of the command to delete
|
|
167
154
|
* @param options - The options for deleting the command
|
|
168
155
|
*/
|
|
169
|
-
async deleteGuildCommand(applicationId, guildId, commandId,
|
|
170
|
-
await this.rest.delete(Routes.applicationGuildCommand(applicationId, guildId, commandId),
|
|
156
|
+
async deleteGuildCommand(applicationId, guildId, commandId, options = {}) {
|
|
157
|
+
await this.rest.delete(Routes.applicationGuildCommand(applicationId, guildId, commandId), options);
|
|
171
158
|
}
|
|
172
159
|
/**
|
|
173
160
|
* Bulk overwrites guild commands
|
|
@@ -178,11 +165,10 @@ export class ApplicationCommandsAPI {
|
|
|
178
165
|
* @param body - The data for overwriting commands
|
|
179
166
|
* @param options - The options for overwriting the commands
|
|
180
167
|
*/
|
|
181
|
-
async bulkOverwriteGuildCommands(applicationId, guildId, body,
|
|
168
|
+
async bulkOverwriteGuildCommands(applicationId, guildId, body, options = {}) {
|
|
182
169
|
return this.rest.put(Routes.applicationGuildCommands(applicationId, guildId), {
|
|
183
|
-
|
|
170
|
+
...options,
|
|
184
171
|
body,
|
|
185
|
-
signal,
|
|
186
172
|
});
|
|
187
173
|
}
|
|
188
174
|
/**
|
|
@@ -194,11 +180,8 @@ export class ApplicationCommandsAPI {
|
|
|
194
180
|
* @param commandId - The command id to get the permissions for
|
|
195
181
|
* @param options - The option for fetching the command
|
|
196
182
|
*/
|
|
197
|
-
async getGuildCommandPermissions(applicationId, guildId, commandId,
|
|
198
|
-
return this.rest.get(Routes.applicationCommandPermissions(applicationId, guildId, commandId),
|
|
199
|
-
auth,
|
|
200
|
-
signal,
|
|
201
|
-
});
|
|
183
|
+
async getGuildCommandPermissions(applicationId, guildId, commandId, options = {}) {
|
|
184
|
+
return this.rest.get(Routes.applicationCommandPermissions(applicationId, guildId, commandId), options);
|
|
202
185
|
}
|
|
203
186
|
/**
|
|
204
187
|
* Fetches all permissions for all commands in a guild
|
|
@@ -208,11 +191,8 @@ export class ApplicationCommandsAPI {
|
|
|
208
191
|
* @param guildId - The guild id to get the permissions for
|
|
209
192
|
* @param options - The options for fetching permissions
|
|
210
193
|
*/
|
|
211
|
-
async getGuildCommandsPermissions(applicationId, guildId,
|
|
212
|
-
return this.rest.get(Routes.guildApplicationCommandsPermissions(applicationId, guildId),
|
|
213
|
-
auth,
|
|
214
|
-
signal,
|
|
215
|
-
});
|
|
194
|
+
async getGuildCommandsPermissions(applicationId, guildId, options = {}) {
|
|
195
|
+
return this.rest.get(Routes.guildApplicationCommandsPermissions(applicationId, guildId), options);
|
|
216
196
|
}
|
|
217
197
|
/**
|
|
218
198
|
* Edits the permissions for a guild command
|
|
@@ -225,12 +205,12 @@ export class ApplicationCommandsAPI {
|
|
|
225
205
|
* @param body - The data for editing the permissions
|
|
226
206
|
* @param options - The options for editing the permissions
|
|
227
207
|
*/
|
|
228
|
-
async editGuildCommandPermissions(userToken, applicationId, guildId, commandId, body, {
|
|
208
|
+
async editGuildCommandPermissions(userToken, applicationId, guildId, commandId, body, { headers, ...options } = {}) {
|
|
229
209
|
return this.rest.put(Routes.applicationCommandPermissions(applicationId, guildId, commandId), {
|
|
230
|
-
|
|
210
|
+
...options,
|
|
211
|
+
headers: { ...headers, Authorization: `Bearer ${userToken.replace('Bearer ', '')}` },
|
|
231
212
|
auth: false,
|
|
232
213
|
body,
|
|
233
|
-
signal,
|
|
234
214
|
});
|
|
235
215
|
}
|
|
236
216
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applicationCommands.js","sourceRoot":"","sources":["../../src/api/applicationCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"applicationCommands.js","sourceRoot":"","sources":["../../src/api/applicationCommands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAa,MAAM,iBAAiB,CAAC;AACjE,OAAO,EACN,MAAM,GAyBN,MAAM,uBAAuB,CAAC;AAG/B,MAAM,OAAO,sBAAsB;IACE,IAAI;IAAxC,YAAoC,IAAU;oBAAV,IAAI;IAAS,CAAC;IAElD;;;;;;;OAOG;IACI,KAAK,CAAC,iBAAiB,CAC7B,aAAwB,EACxB,KAAK,GAAuC,EAAE,EAC9C,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,GAAyC,EAAE;QAE1E,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,aAAa,CAAC,EAAE;YAC/D,GAAG,OAAO;YACV,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,EAAE,GAAG,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,OAAO;YACtE,KAAK,EAAE,mBAAmB,CAAC,KAAK,CAAC;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B,OAAkB,EAClB,SAAoB,EACpB,IAAqD,EACrD,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,GAAuB,EAAE;QAEhD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,6BAA6B,CAAC,aAAa,EAAE,OAAO,EAAE,SAAS,CAAC,EAAE;YAC7F,GAAG,OAAO;YACV,OAAO,EAAE,EAAE,GAAG,OAAO,EAAE,aAAa,EAAE,UAAU,SAAS,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,EAAE;YACpF,IAAI,EAAE,KAAK;YACX,IAAI;SACJ,CAA2D,CAAC;IAC9D,CAAC;CACD"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { REST } from '@discordjs/rest';
|
|
2
2
|
import { type RESTGetAPIApplicationEmojisResult, type RESTPatchAPIApplicationEmojiJSONBody, type RESTPatchCurrentApplicationJSONBody, type RESTPostAPIApplicationEmojiJSONBody, type Snowflake } from 'discord-api-types/v10';
|
|
3
|
+
import type { RequestOptions } from '../util/types.js';
|
|
3
4
|
export declare class ApplicationsAPI {
|
|
4
5
|
private readonly rest;
|
|
5
6
|
constructor(rest: REST);
|
|
@@ -9,7 +10,7 @@ export declare class ApplicationsAPI {
|
|
|
9
10
|
* @see {@link https://discord.com/developers/docs/resources/application#get-current-application}
|
|
10
11
|
* @param options - The options for fetching the application
|
|
11
12
|
*/
|
|
12
|
-
getCurrent(
|
|
13
|
+
getCurrent(options?: RequestOptions): Promise<import("discord-api-types/v10").APIApplication>;
|
|
13
14
|
/**
|
|
14
15
|
* Edits properties of the application associated with the requesting bot user.
|
|
15
16
|
*
|
|
@@ -17,7 +18,7 @@ export declare class ApplicationsAPI {
|
|
|
17
18
|
* @param body - The new application data
|
|
18
19
|
* @param options - The options for editing the application
|
|
19
20
|
*/
|
|
20
|
-
editCurrent(body: RESTPatchCurrentApplicationJSONBody,
|
|
21
|
+
editCurrent(body: RESTPatchCurrentApplicationJSONBody, options?: RequestOptions): Promise<import("discord-api-types/v10").APIApplication>;
|
|
21
22
|
/**
|
|
22
23
|
* Fetches all emojis of an application
|
|
23
24
|
*
|
|
@@ -25,7 +26,7 @@ export declare class ApplicationsAPI {
|
|
|
25
26
|
* @param applicationId - The id of the application to fetch the emojis of
|
|
26
27
|
* @param options - The options for fetching the emojis
|
|
27
28
|
*/
|
|
28
|
-
getEmojis(applicationId: Snowflake,
|
|
29
|
+
getEmojis(applicationId: Snowflake, options?: RequestOptions): Promise<RESTGetAPIApplicationEmojisResult>;
|
|
29
30
|
/**
|
|
30
31
|
* Fetches an emoji of an application
|
|
31
32
|
*
|
|
@@ -34,7 +35,7 @@ export declare class ApplicationsAPI {
|
|
|
34
35
|
* @param emojiId - The id of the emoji to fetch
|
|
35
36
|
* @param options - The options for fetching the emoji
|
|
36
37
|
*/
|
|
37
|
-
getEmoji(applicationId: Snowflake, emojiId: Snowflake,
|
|
38
|
+
getEmoji(applicationId: Snowflake, emojiId: Snowflake, options?: RequestOptions): Promise<import("discord-api-types/v10").APIApplicationEmoji>;
|
|
38
39
|
/**
|
|
39
40
|
* Creates a new emoji of an application
|
|
40
41
|
*
|
|
@@ -43,7 +44,7 @@ export declare class ApplicationsAPI {
|
|
|
43
44
|
* @param body - The data for creating the emoji
|
|
44
45
|
* @param options - The options for creating the emoji
|
|
45
46
|
*/
|
|
46
|
-
createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody,
|
|
47
|
+
createEmoji(applicationId: Snowflake, body: RESTPostAPIApplicationEmojiJSONBody, options?: RequestOptions): Promise<import("discord-api-types/v10").APIApplicationEmoji>;
|
|
47
48
|
/**
|
|
48
49
|
* Edits an emoji of an application
|
|
49
50
|
*
|
|
@@ -53,7 +54,7 @@ export declare class ApplicationsAPI {
|
|
|
53
54
|
* @param body - The data for editing the emoji
|
|
54
55
|
* @param options - The options for editing the emoji
|
|
55
56
|
*/
|
|
56
|
-
editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody,
|
|
57
|
+
editEmoji(applicationId: Snowflake, emojiId: Snowflake, body: RESTPatchAPIApplicationEmojiJSONBody, options?: RequestOptions): Promise<import("discord-api-types/v10").APIApplicationEmoji>;
|
|
57
58
|
/**
|
|
58
59
|
* Deletes an emoji of an application
|
|
59
60
|
*
|
|
@@ -62,7 +63,7 @@ export declare class ApplicationsAPI {
|
|
|
62
63
|
* @param emojiId - The id of the emoji to delete
|
|
63
64
|
* @param options - The options for deleting the emoji
|
|
64
65
|
*/
|
|
65
|
-
deleteEmoji(applicationId: Snowflake, emojiId: Snowflake,
|
|
66
|
+
deleteEmoji(applicationId: Snowflake, emojiId: Snowflake, options?: RequestOptions): Promise<void>;
|
|
66
67
|
/**
|
|
67
68
|
* Fetches an activity instance of an application
|
|
68
69
|
*
|
|
@@ -71,6 +72,6 @@ export declare class ApplicationsAPI {
|
|
|
71
72
|
* @param instanceId - The id of the activity instance to fetch
|
|
72
73
|
* @param options - The options for fetching the activity instance
|
|
73
74
|
*/
|
|
74
|
-
getActivityInstance(applicationId: Snowflake, instanceId: string,
|
|
75
|
+
getActivityInstance(applicationId: Snowflake, instanceId: string, options?: RequestOptions): Promise<import("discord-api-types/v10").APIActivityInstance>;
|
|
75
76
|
}
|
|
76
77
|
//# sourceMappingURL=applications.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../src/api/applications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"applications.d.ts","sourceRoot":"","sources":["../../src/api/applications.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAIN,KAAK,iCAAiC,EAEtC,KAAK,oCAAoC,EAEzC,KAAK,mCAAmC,EAExC,KAAK,mCAAmC,EAExC,KAAK,SAAS,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,qBAAa,eAAe;IACR,OAAO,CAAC,QAAQ,CAAC,IAAI;IAAxC,YAAoC,IAAI,EAAE,IAAI,EAAI;IAElD;;;;;OAKG;IACU,UAAU,CAAC,OAAO,GAAE,cAAmB,2DAEnD;IAED;;;;;;OAMG;IACU,WAAW,CAAC,IAAI,EAAE,mCAAmC,EAAE,OAAO,GAAE,cAAmB,2DAK/F;IAED;;;;;;OAMG;IACU,SAAS,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,GAAE,cAAmB,8CAK5E;IAED;;;;;;;OAOG;IACU,QAAQ,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAE,cAAmB,gEAK/F;IAED;;;;;;;OAOG;IACU,WAAW,CACvB,aAAa,EAAE,SAAS,EACxB,IAAI,EAAE,mCAAmC,EACzC,OAAO,GAAE,cAAmB,gEAM5B;IAED;;;;;;;;OAQG;IACU,SAAS,CACrB,aAAa,EAAE,SAAS,EACxB,OAAO,EAAE,SAAS,EAClB,IAAI,EAAE,oCAAoC,EAC1C,OAAO,GAAE,cAAmB,gEAM5B;IAED;;;;;;;OAOG;IACU,WAAW,CAAC,aAAa,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GAAE,cAAmB,iBAElG;IAED;;;;;;;OAOG;IACU,mBAAmB,CAAC,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,OAAO,GAAE,cAAmB,gEAK1G;CACD"}
|
package/dist/api/applications.js
CHANGED
|
@@ -10,8 +10,8 @@ export class ApplicationsAPI {
|
|
|
10
10
|
* @see {@link https://discord.com/developers/docs/resources/application#get-current-application}
|
|
11
11
|
* @param options - The options for fetching the application
|
|
12
12
|
*/
|
|
13
|
-
async getCurrent(
|
|
14
|
-
return this.rest.get(Routes.currentApplication(),
|
|
13
|
+
async getCurrent(options = {}) {
|
|
14
|
+
return this.rest.get(Routes.currentApplication(), options);
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
17
17
|
* Edits properties of the application associated with the requesting bot user.
|
|
@@ -20,11 +20,10 @@ export class ApplicationsAPI {
|
|
|
20
20
|
* @param body - The new application data
|
|
21
21
|
* @param options - The options for editing the application
|
|
22
22
|
*/
|
|
23
|
-
async editCurrent(body,
|
|
23
|
+
async editCurrent(body, options = {}) {
|
|
24
24
|
return this.rest.patch(Routes.currentApplication(), {
|
|
25
|
-
|
|
25
|
+
...options,
|
|
26
26
|
body,
|
|
27
|
-
signal,
|
|
28
27
|
});
|
|
29
28
|
}
|
|
30
29
|
/**
|
|
@@ -34,11 +33,8 @@ export class ApplicationsAPI {
|
|
|
34
33
|
* @param applicationId - The id of the application to fetch the emojis of
|
|
35
34
|
* @param options - The options for fetching the emojis
|
|
36
35
|
*/
|
|
37
|
-
async getEmojis(applicationId,
|
|
38
|
-
return this.rest.get(Routes.applicationEmojis(applicationId),
|
|
39
|
-
auth,
|
|
40
|
-
signal,
|
|
41
|
-
});
|
|
36
|
+
async getEmojis(applicationId, options = {}) {
|
|
37
|
+
return this.rest.get(Routes.applicationEmojis(applicationId), options);
|
|
42
38
|
}
|
|
43
39
|
/**
|
|
44
40
|
* Fetches an emoji of an application
|
|
@@ -48,11 +44,8 @@ export class ApplicationsAPI {
|
|
|
48
44
|
* @param emojiId - The id of the emoji to fetch
|
|
49
45
|
* @param options - The options for fetching the emoji
|
|
50
46
|
*/
|
|
51
|
-
async getEmoji(applicationId, emojiId,
|
|
52
|
-
return this.rest.get(Routes.applicationEmoji(applicationId, emojiId),
|
|
53
|
-
auth,
|
|
54
|
-
signal,
|
|
55
|
-
});
|
|
47
|
+
async getEmoji(applicationId, emojiId, options = {}) {
|
|
48
|
+
return this.rest.get(Routes.applicationEmoji(applicationId, emojiId), options);
|
|
56
49
|
}
|
|
57
50
|
/**
|
|
58
51
|
* Creates a new emoji of an application
|
|
@@ -62,11 +55,10 @@ export class ApplicationsAPI {
|
|
|
62
55
|
* @param body - The data for creating the emoji
|
|
63
56
|
* @param options - The options for creating the emoji
|
|
64
57
|
*/
|
|
65
|
-
async createEmoji(applicationId, body,
|
|
58
|
+
async createEmoji(applicationId, body, options = {}) {
|
|
66
59
|
return this.rest.post(Routes.applicationEmojis(applicationId), {
|
|
67
|
-
|
|
60
|
+
...options,
|
|
68
61
|
body,
|
|
69
|
-
signal,
|
|
70
62
|
});
|
|
71
63
|
}
|
|
72
64
|
/**
|
|
@@ -78,11 +70,10 @@ export class ApplicationsAPI {
|
|
|
78
70
|
* @param body - The data for editing the emoji
|
|
79
71
|
* @param options - The options for editing the emoji
|
|
80
72
|
*/
|
|
81
|
-
async editEmoji(applicationId, emojiId, body,
|
|
73
|
+
async editEmoji(applicationId, emojiId, body, options = {}) {
|
|
82
74
|
return this.rest.patch(Routes.applicationEmoji(applicationId, emojiId), {
|
|
83
|
-
|
|
75
|
+
...options,
|
|
84
76
|
body,
|
|
85
|
-
signal,
|
|
86
77
|
});
|
|
87
78
|
}
|
|
88
79
|
/**
|
|
@@ -93,8 +84,8 @@ export class ApplicationsAPI {
|
|
|
93
84
|
* @param emojiId - The id of the emoji to delete
|
|
94
85
|
* @param options - The options for deleting the emoji
|
|
95
86
|
*/
|
|
96
|
-
async deleteEmoji(applicationId, emojiId,
|
|
97
|
-
await this.rest.delete(Routes.applicationEmoji(applicationId, emojiId),
|
|
87
|
+
async deleteEmoji(applicationId, emojiId, options = {}) {
|
|
88
|
+
await this.rest.delete(Routes.applicationEmoji(applicationId, emojiId), options);
|
|
98
89
|
}
|
|
99
90
|
/**
|
|
100
91
|
* Fetches an activity instance of an application
|
|
@@ -104,11 +95,8 @@ export class ApplicationsAPI {
|
|
|
104
95
|
* @param instanceId - The id of the activity instance to fetch
|
|
105
96
|
* @param options - The options for fetching the activity instance
|
|
106
97
|
*/
|
|
107
|
-
async getActivityInstance(applicationId, instanceId,
|
|
108
|
-
return this.rest.get(Routes.applicationActivityInstance(applicationId, instanceId),
|
|
109
|
-
auth,
|
|
110
|
-
signal,
|
|
111
|
-
});
|
|
98
|
+
async getActivityInstance(applicationId, instanceId, options = {}) {
|
|
99
|
+
return this.rest.get(Routes.applicationActivityInstance(applicationId, instanceId), options);
|
|
112
100
|
}
|
|
113
101
|
}
|
|
114
102
|
//# sourceMappingURL=applications.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"applications.js","sourceRoot":"","sources":["../../src/api/applications.ts"],"names":[],"mappings":"AACA,OAAO,EACN,MAAM,GAYN,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"applications.js","sourceRoot":"","sources":["../../src/api/applications.ts"],"names":[],"mappings":"AACA,OAAO,EACN,MAAM,GAYN,MAAM,uBAAuB,CAAC;AAG/B,MAAM,OAAO,eAAe;IACS,IAAI;IAAxC,YAAoC,IAAU;oBAAV,IAAI;IAAS,CAAC;IAElD;;;;;OAKG;IACI,KAAK,CAAC,UAAU,CAAC,OAAO,GAAmB,EAAE;QACnD,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE,OAAO,CAA6C,CAAC;IACxG,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,WAAW,CAAC,IAAyC,EAAE,OAAO,GAAmB,EAAE;QAC/F,OAAO,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAAE,EAAE;YACnD,GAAG,OAAO;YACV,IAAI;SACJ,CAA+C,CAAC;IAClD,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,SAAS,CAAC,aAAwB,EAAE,OAAO,GAAmB,EAAE;QAC5E,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CACnB,MAAM,CAAC,iBAAiB,CAAC,aAAa,CAAC,EACvC,OAAO,CACuC,CAAC;IACjD,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,QAAQ,CAAC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