Skip to content

Commit def67db

Browse files
feat(webhook): add with_components query param (#1208)
* feat(webhook): add `with_components` query param * docs: use `defaultValue` Co-authored-by: Jiralite <[email protected]> --------- Co-authored-by: Jiralite <[email protected]>
1 parent ac4d59d commit def67db

File tree

4 files changed

+68
-20
lines changed

4 files changed

+68
-20
lines changed

Diff for: deno/rest/v10/webhook.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ export interface RESTPostAPIWebhookWithTokenQuery {
190190
* Available only if the {@link RESTPostAPIWebhookWithTokenJSONBody.thread_name} JSON body property is not specified
191191
*/
192192
thread_id?: Snowflake;
193+
/**
194+
* Whether to allow sending (non-interactive) components for non-application-owned webhooks
195+
* (defaults to `false`; ignored for application-owned webhooks)
196+
*
197+
* @defaultValue `false`
198+
*/
199+
with_components?: boolean;
193200
}
194201

195202
/**
@@ -208,7 +215,7 @@ export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
208215
/**
209216
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-query-string-params
210217
*/
211-
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
218+
export type RESTPostAPIWebhookWithTokenSlackQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'wait'>;
212219

213220
/**
214221
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
@@ -226,7 +233,7 @@ export type RESTPostAPIWebhookWithTokenSlackWaitResult = APIMessage;
226233
/**
227234
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-query-string-params
228235
*/
229-
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
236+
export type RESTPostAPIWebhookWithTokenGitHubQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'wait'>;
230237

231238
/**
232239
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
@@ -288,6 +295,11 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
288295
})
289296
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody);
290297

298+
/**
299+
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message-query-string-params
300+
*/
301+
export type RESTPatchAPIWebhookWithTokenQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'with_components'>;
302+
291303
/**
292304
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
293305
*/

Diff for: deno/rest/v9/webhook.ts

+20-8
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
174174
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody);
175175

176176
/**
177-
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
177+
* https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params
178178
*/
179179
export interface RESTPostAPIWebhookWithTokenQuery {
180180
/**
@@ -190,6 +190,13 @@ export interface RESTPostAPIWebhookWithTokenQuery {
190190
* Available only if the {@link RESTPostAPIWebhookWithTokenJSONBody.thread_name} JSON body property is not specified
191191
*/
192192
thread_id?: Snowflake;
193+
/**
194+
* Whether to allow sending (non-interactive) components for non-application-owned webhooks
195+
* (defaults to `false`; ignored for application-owned webhooks)
196+
*
197+
* @defaultValue `false`
198+
*/
199+
with_components?: boolean;
193200
}
194201

195202
/**
@@ -201,14 +208,14 @@ export type RESTPostAPIWebhookWithTokenResult = never;
201208
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
202209
* the `wait` query parameter set to `true`
203210
*
204-
* See https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
211+
* See https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params
205212
*/
206213
export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
207214

208215
/**
209-
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
216+
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-query-string-params
210217
*/
211-
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
218+
export type RESTPostAPIWebhookWithTokenSlackQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'wait'>;
212219

213220
/**
214221
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
@@ -219,14 +226,14 @@ export type RESTPostAPIWebhookWithTokenSlackResult = never;
219226
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
220227
* the `wait` query parameter set to `true`
221228
*
222-
* See https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
229+
* See https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-query-string-params
223230
*/
224231
export type RESTPostAPIWebhookWithTokenSlackWaitResult = APIMessage;
225232

226233
/**
227-
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
234+
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-query-string-params
228235
*/
229-
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
236+
export type RESTPostAPIWebhookWithTokenGitHubQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'wait'>;
230237

231238
/**
232239
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
@@ -237,7 +244,7 @@ export type RESTPostAPIWebhookWithTokenGitHubResult = never;
237244
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
238245
* the `wait` query parameter set to `true`
239246
*
240-
* See https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
247+
* See https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-query-string-params
241248
*/
242249
export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
243250

@@ -288,6 +295,11 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
288295
})
289296
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody);
290297

298+
/**
299+
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message-query-string-params
300+
*/
301+
export type RESTPatchAPIWebhookWithTokenQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'with_components'>;
302+
291303
/**
292304
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
293305
*/

Diff for: rest/v10/webhook.ts

+14-2
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,13 @@ export interface RESTPostAPIWebhookWithTokenQuery {
190190
* Available only if the {@link RESTPostAPIWebhookWithTokenJSONBody.thread_name} JSON body property is not specified
191191
*/
192192
thread_id?: Snowflake;
193+
/**
194+
* Whether to allow sending (non-interactive) components for non-application-owned webhooks
195+
* (defaults to `false`; ignored for application-owned webhooks)
196+
*
197+
* @defaultValue `false`
198+
*/
199+
with_components?: boolean;
193200
}
194201

195202
/**
@@ -208,7 +215,7 @@ export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
208215
/**
209216
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-query-string-params
210217
*/
211-
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
218+
export type RESTPostAPIWebhookWithTokenSlackQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'wait'>;
212219

213220
/**
214221
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
@@ -226,7 +233,7 @@ export type RESTPostAPIWebhookWithTokenSlackWaitResult = APIMessage;
226233
/**
227234
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-query-string-params
228235
*/
229-
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
236+
export type RESTPostAPIWebhookWithTokenGitHubQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'wait'>;
230237

231238
/**
232239
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
@@ -288,6 +295,11 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
288295
})
289296
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody);
290297

298+
/**
299+
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message-query-string-params
300+
*/
301+
export type RESTPatchAPIWebhookWithTokenQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'with_components'>;
302+
291303
/**
292304
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
293305
*/

Diff for: rest/v9/webhook.ts

+20-8
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export type RESTPostAPIWebhookWithTokenFormDataBody =
174174
| (Record<`files[${bigint}]`, unknown> & RESTPostAPIWebhookWithTokenJSONBody);
175175

176176
/**
177-
* https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
177+
* https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params
178178
*/
179179
export interface RESTPostAPIWebhookWithTokenQuery {
180180
/**
@@ -190,6 +190,13 @@ export interface RESTPostAPIWebhookWithTokenQuery {
190190
* Available only if the {@link RESTPostAPIWebhookWithTokenJSONBody.thread_name} JSON body property is not specified
191191
*/
192192
thread_id?: Snowflake;
193+
/**
194+
* Whether to allow sending (non-interactive) components for non-application-owned webhooks
195+
* (defaults to `false`; ignored for application-owned webhooks)
196+
*
197+
* @defaultValue `false`
198+
*/
199+
with_components?: boolean;
193200
}
194201

195202
/**
@@ -201,14 +208,14 @@ export type RESTPostAPIWebhookWithTokenResult = never;
201208
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
202209
* the `wait` query parameter set to `true`
203210
*
204-
* See https://discord.com/developers/docs/resources/webhook#execute-webhook-querystring-params
211+
* See https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params
205212
*/
206213
export type RESTPostAPIWebhookWithTokenWaitResult = APIMessage;
207214

208215
/**
209-
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
216+
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-query-string-params
210217
*/
211-
export type RESTPostAPIWebhookWithTokenSlackQuery = RESTPostAPIWebhookWithTokenQuery;
218+
export type RESTPostAPIWebhookWithTokenSlackQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'wait'>;
212219

213220
/**
214221
* https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook
@@ -219,14 +226,14 @@ export type RESTPostAPIWebhookWithTokenSlackResult = never;
219226
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
220227
* the `wait` query parameter set to `true`
221228
*
222-
* See https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-querystring-params
229+
* See https://discord.com/developers/docs/resources/webhook#execute-slackcompatible-webhook-query-string-params
223230
*/
224231
export type RESTPostAPIWebhookWithTokenSlackWaitResult = APIMessage;
225232

226233
/**
227-
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
234+
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-query-string-params
228235
*/
229-
export type RESTPostAPIWebhookWithTokenGitHubQuery = RESTPostAPIWebhookWithTokenQuery;
236+
export type RESTPostAPIWebhookWithTokenGitHubQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'wait'>;
230237

231238
/**
232239
* https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook
@@ -237,7 +244,7 @@ export type RESTPostAPIWebhookWithTokenGitHubResult = never;
237244
* Received when a call to https://discord.com/developers/docs/resources/webhook#execute-webhook receives
238245
* the `wait` query parameter set to `true`
239246
*
240-
* See https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-querystring-params
247+
* See https://discord.com/developers/docs/resources/webhook#execute-githubcompatible-webhook-query-string-params
241248
*/
242249
export type RESTPostAPIWebhookWithTokenGitHubWaitResult = APIMessage;
243250

@@ -288,6 +295,11 @@ export type RESTPatchAPIWebhookWithTokenMessageFormDataBody =
288295
})
289296
| (Record<`files[${bigint}]`, unknown> & RESTPatchAPIWebhookWithTokenMessageJSONBody);
290297

298+
/**
299+
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message-query-string-params
300+
*/
301+
export type RESTPatchAPIWebhookWithTokenQuery = Pick<RESTPostAPIWebhookWithTokenQuery, 'thread_id' | 'with_components'>;
302+
291303
/**
292304
* https://discord.com/developers/docs/resources/webhook#edit-webhook-message
293305
*/

0 commit comments

Comments
 (0)