discord.js 14.19.0 → 14.19.1

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "discord.js",
4
- "version": "14.19.0",
4
+ "version": "14.19.1",
5
5
  "description": "A powerful library for interacting with the Discord API",
6
6
  "main": "./src/index.js",
7
7
  "types": "./typings/index.d.ts",
@@ -82,8 +82,8 @@
82
82
  "turbo": "^2.0.14",
83
83
  "typescript": "~5.5.4",
84
84
  "@discordjs/api-extractor": "^7.38.1",
85
- "@discordjs/docgen": "^0.12.1",
86
- "@discordjs/scripts": "^0.1.0"
85
+ "@discordjs/scripts": "^0.1.0",
86
+ "@discordjs/docgen": "^0.12.1"
87
87
  },
88
88
  "engines": {
89
89
  "node": ">=18"
@@ -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
  );
@@ -7559,6 +7559,7 @@ export interface WebhookEditOptions {
7559
7559
 
7560
7560
  export interface WebhookMessageEditOptions extends MessageEditOptions {
7561
7561
  threadId?: Snowflake;
7562
+ withComponents?: boolean;
7562
7563
  }
7563
7564
 
7564
7565
  export interface InteractionEditReplyOptions
@@ -7578,6 +7579,7 @@ export interface WebhookMessageCreateOptions
7578
7579
  threadId?: Snowflake;
7579
7580
  threadName?: string;
7580
7581
  appliedTags?: readonly Snowflake[];
7582
+ withComponents?: boolean;
7581
7583
  }
7582
7584
 
7583
7585
  export interface WebSocketOptions {
@@ -7559,6 +7559,7 @@ export interface WebhookEditOptions {
7559
7559
 
7560
7560
  export interface WebhookMessageEditOptions extends MessageEditOptions {
7561
7561
  threadId?: Snowflake;
7562
+ withComponents?: boolean;
7562
7563
  }
7563
7564
 
7564
7565
  export interface InteractionEditReplyOptions
@@ -7578,6 +7579,7 @@ export interface WebhookMessageCreateOptions
7578
7579
  threadId?: Snowflake;
7579
7580
  threadName?: string;
7580
7581
  appliedTags?: readonly Snowflake[];
7582
+ withComponents?: boolean;
7581
7583
  }
7582
7584
 
7583
7585
  export interface WebSocketOptions {