.setDescription(description)
description: string | null → this
attachmentBuilder.setDescription(description);Class
File attachment for files: [builder] send paths.
new AttachmentBuilder(file: AttachmentFileInput, options: AttachmentBuilderOptions)AttachmentBuilderOptions| Name | Type | Description |
|---|---|---|
| attachmentread-only | Blob | ArrayBuffer | Uint8Array | null | Local file bytes when constructed with a buffer/blob. |
| description? | string | null | Alt text / description for accessibility. |
| filenameread-only | string | Filename alias used by send helpers (same as name). |
| name | string | Display / upload name (may include SPOILER_ prefix). |
| spoiler | boolean | Whether this attachment should be hidden until clicked. |
| urlread-only | string | null | Remote URL when constructed with a string URL. |
description: string | null → this
attachmentBuilder.setDescription(description);name: string → this
attachmentBuilder.setName(name);spoiler: boolean → this
attachmentBuilder.setSpoiler(spoiler);→ | { name: string; data: Blob | ArrayBuffer | Uint8Array; filename: string } | { name: string; url: string; filename: string }
Convert to the { name, data | url } shape used by message send helpers.
attachmentBuilder.toFileData();