@@ -137,6 +137,8 @@ class Webhook {
137
137
* @property {string } [threadName] Name of the thread to create (only available if the webhook is in a forum channel)
138
138
* @property {Snowflake[] } [appliedTags]
139
139
* The tags to apply to the created thread (only available if the webhook is in a forum channel)
140
+ * @property {boolean } [withComponents] Whether to allow sending non-interactive components in the message.
141
+ * <info>For application-owned webhooks, this property is ignored</info>
140
142
*/
141
143
142
144
/**
@@ -219,7 +221,7 @@ class Webhook {
219
221
const query = makeURLSearchParams ( {
220
222
wait : true ,
221
223
thread_id : messagePayload . options . threadId ,
222
- with_components : body ?. components ?. length > 0 ,
224
+ with_components : messagePayload . options . withComponents ,
223
225
} ) ;
224
226
225
227
const d = await this . client . rest . post ( Routes . webhook ( this . id , this . token ) , {
@@ -300,6 +302,8 @@ class Webhook {
300
302
* @property {boolean } [cache=true] Whether to cache the message.
301
303
* @property {Snowflake } [threadId] The id of the thread this message belongs to.
302
304
* <info>For interaction webhooks, this property is ignored</info>
305
+ * @property {boolean } [withComponents] Whether to allow sending non-interactive components in the message.
306
+ * <info>For application-owned webhooks, this property is ignored</info>
303
307
*/
304
308
305
309
/**
@@ -339,14 +343,17 @@ class Webhook {
339
343
340
344
const { body, files } = await messagePayload . resolveBody ( ) . resolveFiles ( ) ;
341
345
346
+ const query = makeURLSearchParams ( {
347
+ thread_id : messagePayload . options . threadId ,
348
+ with_components : messagePayload . options . withComponents ,
349
+ } ) ;
350
+
342
351
const d = await this . client . rest . patch (
343
352
Routes . webhookMessage ( this . id , this . token , typeof message === 'string' ? message : message . id ) ,
344
353
{
345
354
body,
346
355
files,
347
- query : messagePayload . options . threadId
348
- ? makeURLSearchParams ( { thread_id : messagePayload . options . threadId } )
349
- : undefined ,
356
+ query,
350
357
auth : false ,
351
358
} ,
352
359
) ;
0 commit comments