discord.js 15.0.0-dev.1757116903-f7c77a73d → 15.0.0-dev.1757160090-352c9819b

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": "15.0.0-dev.1757116903-f7c77a73d",
4
+ "version": "15.0.0-dev.1757160090-352c9819b",
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",
@@ -61,12 +61,12 @@
61
61
  "magic-bytes.js": "^1.12.1",
62
62
  "tslib": "^2.8.1",
63
63
  "undici": "7.11.0",
64
- "@discordjs/collection": "^3.0.0-dev.1757116903-f7c77a73d",
65
- "@discordjs/builders": "^2.0.0-dev.1757116903-f7c77a73d",
66
- "@discordjs/rest": "^3.0.0-dev.1757116903-f7c77a73d",
67
- "@discordjs/formatters": "^1.0.0-dev.1757116903-f7c77a73d",
68
- "@discordjs/ws": "^3.0.0-dev.1757116903-f7c77a73d",
69
- "@discordjs/util": "^2.0.0-dev.1757116903-f7c77a73d"
64
+ "@discordjs/collection": "^3.0.0-dev.1757160090-352c9819b",
65
+ "@discordjs/builders": "^2.0.0-dev.1757160090-352c9819b",
66
+ "@discordjs/formatters": "^1.0.0-dev.1757160090-352c9819b",
67
+ "@discordjs/util": "^2.0.0-dev.1757160090-352c9819b",
68
+ "@discordjs/ws": "^3.0.0-dev.1757160090-352c9819b",
69
+ "@discordjs/rest": "^3.0.0-dev.1757160090-352c9819b"
70
70
  },
71
71
  "devDependencies": {
72
72
  "@favware/cliff-jumper": "^4.1.0",
@@ -82,8 +82,8 @@
82
82
  "tsd": "^0.33.0",
83
83
  "turbo": "^2.5.6",
84
84
  "typescript": "~5.9.2",
85
- "@discordjs/docgen": "^0.12.1",
86
85
  "@discordjs/api-extractor": "^7.52.7",
86
+ "@discordjs/docgen": "^0.12.1",
87
87
  "@discordjs/scripts": "^0.1.0"
88
88
  },
89
89
  "engines": {
@@ -22,7 +22,8 @@ class GuildForumThreadManager extends ThreadManager {
22
22
  * @typedef {BaseMessageOptions} GuildForumThreadMessageCreateOptions
23
23
  * @property {StickerResolvable} [stickers] The stickers to send with the message
24
24
  * @property {BitFieldResolvable} [flags] The flags to send with the message
25
- * <info>Only `MessageFlags.SuppressEmbeds` and `MessageFlags.SuppressNotifications` can be set.</info>
25
+ * <info>Only {@link MessageFlags.SuppressEmbeds}, {@link MessageFlags.SuppressNotifications}, and
26
+ * {@link MessageFlags.IsVoiceMessage} can be set.</info>
26
27
  */
27
28
 
28
29
  /**
@@ -5,9 +5,12 @@ const { basename, flatten } = require('../util/Util.js');
5
5
 
6
6
  /**
7
7
  * @typedef {Object} AttachmentPayload
8
- * @property {?string} name The name of the attachment
9
8
  * @property {Stream|BufferResolvable} attachment The attachment in this payload
10
- * @property {?string} description The description of the attachment
9
+ * @property {string} [name] The name of the attachment
10
+ * @property {string} [description] The description of the attachment
11
+ * @property {title} [title] The title of the attachment
12
+ * @property {string} [waveform] The base64 encoded byte array representing a sampled waveform (from voice message attachments)
13
+ * @property {number} [duration] The duration of the attachment in seconds (from voice message attachments)
11
14
  */
12
15
 
13
16
  /**
@@ -115,7 +118,7 @@ class Attachment {
115
118
  if ('duration_secs' in data) {
116
119
  /**
117
120
  * The duration of this attachment in seconds
118
- * <info>This will only be available if the attachment is an audio file.</info>
121
+ * <info>This will only be available if the attachment is the audio file from a voice message.</info>
119
122
  *
120
123
  * @type {?number}
121
124
  */
@@ -127,7 +130,7 @@ class Attachment {
127
130
  if ('waveform' in data) {
128
131
  /**
129
132
  * The base64 encoded byte array representing a sampled waveform
130
- * <info>This will only be available if the attachment is an audio file.</info>
133
+ * <info>This will only be available if this attachment is the audio file from a voice message.</info>
131
134
  *
132
135
  * @type {?string}
133
136
  */
@@ -17,18 +17,43 @@ class AttachmentBuilder {
17
17
  * @type {BufferResolvable|Stream}
18
18
  */
19
19
  this.attachment = attachment;
20
+
20
21
  /**
21
22
  * The name of this attachment
22
23
  *
23
24
  * @type {?string}
24
25
  */
25
26
  this.name = data.name;
27
+
26
28
  /**
27
29
  * The description of the attachment
28
30
  *
29
31
  * @type {?string}
30
32
  */
31
33
  this.description = data.description;
34
+
35
+ /**
36
+ * The title of the attachment
37
+ *
38
+ * @type {?string}
39
+ */
40
+ this.title = data.title;
41
+
42
+ /**
43
+ * The base64 encoded byte array representing a sampled waveform
44
+ * <info>This is only for voice message attachments.</info>
45
+ *
46
+ * @type {?string}
47
+ */
48
+ this.waveform = data.waveform;
49
+
50
+ /**
51
+ * The duration of the attachment in seconds
52
+ * <info>This is only for voice message attachments.</info>
53
+ *
54
+ * @type {?number}
55
+ */
56
+ this.duration = data.duration;
32
57
  }
33
58
 
34
59
  /**
@@ -64,6 +89,41 @@ class AttachmentBuilder {
64
89
  return this;
65
90
  }
66
91
 
92
+ /**
93
+ * Sets the title of this attachment.
94
+ *
95
+ * @param {string} title The title of the file
96
+ * @returns {AttachmentBuilder} This attachment
97
+ */
98
+ setTitle(title) {
99
+ this.title = title;
100
+ return this;
101
+ }
102
+
103
+ /**
104
+ * Sets the waveform of this attachment.
105
+ * <info>This is only for voice message attachments.</info>
106
+ *
107
+ * @param {string} waveform The base64 encoded byte array representing a sampled waveform
108
+ * @returns {AttachmentBuilder} This attachment
109
+ */
110
+ setWaveform(waveform) {
111
+ this.waveform = waveform;
112
+ return this;
113
+ }
114
+
115
+ /**
116
+ * Sets the duration of this attachment.
117
+ * <info>This is only for voice message attachments.</info>
118
+ *
119
+ * @param {number} duration The duration of the attachment in seconds
120
+ * @returns {AttachmentBuilder} This attachment
121
+ */
122
+ setDuration(duration) {
123
+ this.duration = duration;
124
+ return this;
125
+ }
126
+
67
127
  /**
68
128
  * Sets whether this attachment is a spoiler
69
129
  *
@@ -119,4 +179,7 @@ exports.AttachmentBuilder = AttachmentBuilder;
119
179
  * @typedef {Object} AttachmentData
120
180
  * @property {string} [name] The name of the attachment
121
181
  * @property {string} [description] The description of the attachment
182
+ * @property {string} [title] The title of the attachment
183
+ * @property {string} [waveform] The base64 encoded byte array representing a sampled waveform (for voice message attachments)
184
+ * @property {number} [duration] The duration of the attachment in seconds (for voice message attachments)
122
185
  */
@@ -192,6 +192,9 @@ class MessagePayload {
192
192
  const attachments = this.options.files?.map((file, index) => ({
193
193
  id: index.toString(),
194
194
  description: file.description,
195
+ title: file.title,
196
+ waveform: file.waveform,
197
+ duration_secs: file.duration,
195
198
  }));
196
199
  if (Array.isArray(this.options.attachments)) {
197
200
  this.options.attachments.push(...(attachments ?? []));
@@ -142,7 +142,7 @@ class Webhook {
142
142
  * @typedef {BaseMessageOptionsWithPoll} WebhookMessageCreateOptions
143
143
  * @property {boolean} [tts=false] Whether the message should be spoken aloud
144
144
  * @property {MessageFlags} [flags] Which flags to set for the message.
145
- * <info>Only the {@link MessageFlags.SuppressEmbeds} flag can be set.</info>
145
+ * <info>Only {@link MessageFlags.SuppressEmbeds} and {@link MessageFlags.IsVoiceMessage} can be set.</info>
146
146
  * @property {string} [username=this.name] Username override for the message
147
147
  * @property {string} [avatarURL] Avatar URL override for the message
148
148
  * @property {Snowflake} [threadId] The id of the thread in the channel to send to.
@@ -45,8 +45,8 @@ class InteractionResponses {
45
45
  * @property {boolean} [tts=false] Whether the message should be spoken aloud
46
46
  * @property {boolean} [withResponse] Whether to return an {@link InteractionCallbackResponse} as the response
47
47
  * @property {MessageFlagsResolvable} [flags] Which flags to set for the message.
48
- * <info>Only `MessageFlags.Ephemeral`, `MessageFlags.SuppressEmbeds`, and `MessageFlags.SuppressNotifications`
49
- * can be set.</info>
48
+ * <info>Only {@link MessageFlags.Ephemeral}, {@link MessageFlags.SuppressEmbeds},
49
+ * {@link MessageFlags.SuppressNotifications}, and {@link MessageFlags.IsVoiceMessage} can be set.</info>
50
50
  */
51
51
 
52
52
  /**
@@ -114,8 +114,8 @@ class TextBasedChannel {
114
114
  * that message will be returned and no new message will be created
115
115
  * @property {StickerResolvable[]} [stickers=[]] The stickers to send in the message
116
116
  * @property {MessageFlags} [flags] Which flags to set for the message.
117
- * <info>Only {@link MessageFlags.SuppressEmbeds}, {@link MessageFlags.SuppressNotifications} and
118
- * {@link MessageFlags.IsComponentsV2} can be set.</info>
117
+ * <info>Only {@link MessageFlags.SuppressEmbeds}, {@link MessageFlags.SuppressNotifications},
118
+ * {@link MessageFlags.IsComponentsV2}, and {@link MessageFlags.IsVoiceMessage} can be set.</info>
119
119
  * <info>{@link MessageFlags.IsComponentsV2} is required if passing components that aren't action rows</info>
120
120
  */
121
121
 
@@ -2249,10 +2249,16 @@ export class AttachmentBuilder {
2249
2249
  public attachment: BufferResolvable | Stream;
2250
2250
  public description: string | null;
2251
2251
  public name: string | null;
2252
+ public title: string | null;
2253
+ public waveform: string | null;
2254
+ public duration: number | null;
2252
2255
  public get spoiler(): boolean;
2253
2256
  public setDescription(description: string): this;
2254
2257
  public setFile(attachment: BufferResolvable | Stream, name?: string): this;
2255
2258
  public setName(name: string): this;
2259
+ public setTitle(title: string): this;
2260
+ public setWaveform(waveform: string): this;
2261
+ public setDuration(duration: number): this;
2256
2262
  public setSpoiler(spoiler?: boolean): this;
2257
2263
  public toJSON(): unknown;
2258
2264
  public static from(other: JSONEncodable<AttachmentPayload>): AttachmentBuilder;
@@ -4828,7 +4834,10 @@ export interface BaseApplicationCommandData {
4828
4834
 
4829
4835
  export interface AttachmentData {
4830
4836
  description?: string;
4837
+ duration?: number;
4831
4838
  name?: string;
4839
+ title?: string;
4840
+ waveform?: string;
4832
4841
  }
4833
4842
 
4834
4843
  export type CommandOptionDataTypeResolvable = ApplicationCommandOptionType;
@@ -5878,7 +5887,10 @@ export interface FetchThreadsOptions {
5878
5887
  export interface AttachmentPayload {
5879
5888
  attachment: BufferResolvable | Stream;
5880
5889
  description?: string;
5890
+ duration?: number;
5881
5891
  name?: string;
5892
+ title?: string;
5893
+ waveform?: string;
5882
5894
  }
5883
5895
 
5884
5896
  export type GlobalSweepFilter<Key, Value> = () =>
@@ -6398,9 +6410,13 @@ export interface InteractionDeferUpdateOptions {
6398
6410
  export interface InteractionReplyOptions extends BaseMessageOptions, MessageOptionsPoll {
6399
6411
  flags?:
6400
6412
  | BitFieldResolvable<
6401
- Extract<MessageFlagsString, 'Ephemeral' | 'IsComponentsV2' | 'SuppressEmbeds' | 'SuppressNotifications'>,
6413
+ Extract<
6414
+ MessageFlagsString,
6415
+ 'Ephemeral' | 'IsComponentsV2' | 'IsVoiceMessage' | 'SuppressEmbeds' | 'SuppressNotifications'
6416
+ >,
6402
6417
  | MessageFlags.Ephemeral
6403
6418
  | MessageFlags.IsComponentsV2
6419
+ | MessageFlags.IsVoiceMessage
6404
6420
  | MessageFlags.SuppressEmbeds
6405
6421
  | MessageFlags.SuppressNotifications
6406
6422
  >
@@ -6577,8 +6593,11 @@ export interface MessageOptionsPoll {
6577
6593
  export interface MessageOptionsFlags {
6578
6594
  flags?:
6579
6595
  | BitFieldResolvable<
6580
- Extract<MessageFlagsString, 'IsComponentsV2' | 'SuppressEmbeds' | 'SuppressNotifications'>,
6581
- MessageFlags.IsComponentsV2 | MessageFlags.SuppressEmbeds | MessageFlags.SuppressNotifications
6596
+ Extract<MessageFlagsString, 'IsComponentsV2' | 'IsVoiceMessage' | 'SuppressEmbeds' | 'SuppressNotifications'>,
6597
+ | MessageFlags.IsComponentsV2
6598
+ | MessageFlags.IsVoiceMessage
6599
+ | MessageFlags.SuppressEmbeds
6600
+ | MessageFlags.SuppressNotifications
6582
6601
  >
6583
6602
  | undefined;
6584
6603
  }
@@ -2249,10 +2249,16 @@ export class AttachmentBuilder {
2249
2249
  public attachment: BufferResolvable | Stream;
2250
2250
  public description: string | null;
2251
2251
  public name: string | null;
2252
+ public title: string | null;
2253
+ public waveform: string | null;
2254
+ public duration: number | null;
2252
2255
  public get spoiler(): boolean;
2253
2256
  public setDescription(description: string): this;
2254
2257
  public setFile(attachment: BufferResolvable | Stream, name?: string): this;
2255
2258
  public setName(name: string): this;
2259
+ public setTitle(title: string): this;
2260
+ public setWaveform(waveform: string): this;
2261
+ public setDuration(duration: number): this;
2256
2262
  public setSpoiler(spoiler?: boolean): this;
2257
2263
  public toJSON(): unknown;
2258
2264
  public static from(other: JSONEncodable<AttachmentPayload>): AttachmentBuilder;
@@ -4828,7 +4834,10 @@ export interface BaseApplicationCommandData {
4828
4834
 
4829
4835
  export interface AttachmentData {
4830
4836
  description?: string;
4837
+ duration?: number;
4831
4838
  name?: string;
4839
+ title?: string;
4840
+ waveform?: string;
4832
4841
  }
4833
4842
 
4834
4843
  export type CommandOptionDataTypeResolvable = ApplicationCommandOptionType;
@@ -5878,7 +5887,10 @@ export interface FetchThreadsOptions {
5878
5887
  export interface AttachmentPayload {
5879
5888
  attachment: BufferResolvable | Stream;
5880
5889
  description?: string;
5890
+ duration?: number;
5881
5891
  name?: string;
5892
+ title?: string;
5893
+ waveform?: string;
5882
5894
  }
5883
5895
 
5884
5896
  export type GlobalSweepFilter<Key, Value> = () =>
@@ -6398,9 +6410,13 @@ export interface InteractionDeferUpdateOptions {
6398
6410
  export interface InteractionReplyOptions extends BaseMessageOptions, MessageOptionsPoll {
6399
6411
  flags?:
6400
6412
  | BitFieldResolvable<
6401
- Extract<MessageFlagsString, 'Ephemeral' | 'IsComponentsV2' | 'SuppressEmbeds' | 'SuppressNotifications'>,
6413
+ Extract<
6414
+ MessageFlagsString,
6415
+ 'Ephemeral' | 'IsComponentsV2' | 'IsVoiceMessage' | 'SuppressEmbeds' | 'SuppressNotifications'
6416
+ >,
6402
6417
  | MessageFlags.Ephemeral
6403
6418
  | MessageFlags.IsComponentsV2
6419
+ | MessageFlags.IsVoiceMessage
6404
6420
  | MessageFlags.SuppressEmbeds
6405
6421
  | MessageFlags.SuppressNotifications
6406
6422
  >
@@ -6577,8 +6593,11 @@ export interface MessageOptionsPoll {
6577
6593
  export interface MessageOptionsFlags {
6578
6594
  flags?:
6579
6595
  | BitFieldResolvable<
6580
- Extract<MessageFlagsString, 'IsComponentsV2' | 'SuppressEmbeds' | 'SuppressNotifications'>,
6581
- MessageFlags.IsComponentsV2 | MessageFlags.SuppressEmbeds | MessageFlags.SuppressNotifications
6596
+ Extract<MessageFlagsString, 'IsComponentsV2' | 'IsVoiceMessage' | 'SuppressEmbeds' | 'SuppressNotifications'>,
6597
+ | MessageFlags.IsComponentsV2
6598
+ | MessageFlags.IsVoiceMessage
6599
+ | MessageFlags.SuppressEmbeds
6600
+ | MessageFlags.SuppressNotifications
6582
6601
  >
6583
6602
  | undefined;
6584
6603
  }