voice() to send a voice note. It uses the same input shape as attachment: a path or a Buffer plus optional metadata.
options.mimeType is omitted, the builder throws at send time.
Voice
Resolved voice content delivered alongside the message.
Voice
Resolved voice content delivered alongside the message.
| Field | Type | Description |
|---|---|---|
mimeType | string | The audio MIME type, such as audio/mp4. |
name | string (optional) | Filename for the underlying clip. |
duration | number (optional) | Length in seconds. |
size | number (optional) | Byte length, when known up front. |
read() | () => Promise<Buffer> | Materialize the bytes. |
stream() | () => Promise<ReadableStream> | Stream the bytes. Prefer this for large clips. |