Skip to content

Commit b99bf60

Browse files
committed
docs: clarify voice message attachment properties in documentation
1 parent 27032b2 commit b99bf60

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

packages/discord.js/src/structures/Attachment.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const { basename, flatten } = require('../util/Util.js');
99
* @property {string} [name] The name of the attachment
1010
* @property {string} [description] The description of the attachment
1111
* @property {title} [title] The title of the attachment
12-
* @property {string} [waveform] The base64 encoded byte array representing a sampled waveform
13-
* @property {number} [duration] The duration of the attachment in seconds
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)
1414
*/
1515

1616
/**
@@ -118,7 +118,7 @@ class Attachment {
118118
if ('duration_secs' in data) {
119119
/**
120120
* The duration of this attachment in seconds
121-
* <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>
122122
*
123123
* @type {?number}
124124
*/
@@ -130,7 +130,7 @@ class Attachment {
130130
if ('waveform' in data) {
131131
/**
132132
* The base64 encoded byte array representing a sampled waveform
133-
* <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>
134134
*
135135
* @type {?string}
136136
*/

packages/discord.js/src/structures/AttachmentBuilder.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ class AttachmentBuilder {
4141

4242
/**
4343
* The base64 encoded byte array representing a sampled waveform
44+
* <info>This is only for voice message attachments.</info>
4445
*
4546
* @type {?string}
4647
*/
4748
this.waveform = data.waveform;
4849

4950
/**
5051
* The duration of the attachment in seconds
52+
* <info>This is only for voice message attachments.</info>
5153
*
5254
* @type {?number}
5355
*/
@@ -100,6 +102,7 @@ class AttachmentBuilder {
100102

101103
/**
102104
* Sets the waveform of this attachment.
105+
* <info>This is only for voice message attachments.</info>
103106
*
104107
* @param {string} waveform The base64 encoded byte array representing a sampled waveform
105108
* @returns {AttachmentBuilder} This attachment
@@ -111,6 +114,7 @@ class AttachmentBuilder {
111114

112115
/**
113116
* Sets the duration of this attachment.
117+
* <info>This is only for voice message attachments.</info>
114118
*
115119
* @param {number} duration The duration of the attachment in seconds
116120
* @returns {AttachmentBuilder} This attachment
@@ -176,6 +180,6 @@ exports.AttachmentBuilder = AttachmentBuilder;
176180
* @property {string} [name] The name of the attachment
177181
* @property {string} [description] The description of the attachment
178182
* @property {string} [title] The title of the attachment
179-
* @property {string} [waveform] The base64 encoded byte array representing a sampled waveform
180-
* @property {number} [duration] The duration of the attachment in seconds
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)
181185
*/

0 commit comments

Comments
 (0)