feat: voice messages (#9444)

* feat: voice messages

* fix: delete unnesseary error
This commit is contained in:
Jaw0r3k
2023-04-23 21:03:29 +02:00
committed by GitHub
parent 420f379933
commit 3386bab2c0
6 changed files with 54 additions and 4 deletions

View File

@@ -147,6 +147,28 @@ class MessageAttachment {
* @type {boolean}
*/
this.ephemeral = data.ephemeral ?? false;
if ('duration_secs' in data) {
/**
* The duration of this attachment in seconds
* <info>This will only be available if the attachment is an audio file.</info>
* @type {?number}
*/
this.duration = data.duration_secs;
} else {
this.duration ??= null;
}
if ('waveform' in data) {
/**
* The base64 encoded byte array representing a sampled waveform
* <info>This will only be available if the attachment is an audio file.</info>
* @type {?string}
*/
this.waveform = data.waveform;
} else {
this.waveform ??= null;
}
}
/**