.setDescription(description)
description: string | null → this
Set attachment description (alt text for accessibility). Pass null to clear.
- description
string | nullDescription text or null
attachmentBuilder.setDescription(description);Class
Attachment metadata for message payloads (file bytes sent separately).
new AttachmentBuilder(id: number, filename: string, options?: Partial<AttachmentPayloadOptions>)numberstringPartial<AttachmentPayloadOptions>| Name | Type | Description |
|---|---|---|
| description? | string | null | Alt text / description for accessibility. |
| filename | string | Filename (may be prefixed with SPOILER_ if spoiler is true). |
| idread-only | number | Attachment ID (index in files array). |
| spoiler | boolean | Whether this attachment should be hidden until clicked. |
description: string | null → this
Set attachment description (alt text for accessibility). Pass null to clear.
string | nullDescription text or nullattachmentBuilder.setDescription(description);name: string → this
Set attachment filename (preserves spoiler prefix if enabled).
stringNew filenameattachmentBuilder.setName(name);spoiler: boolean → this
Toggle spoiler flag (adds/removes SPOILER_ prefix from filename).
booleanWhether this attachment should be hiddenattachmentBuilder.setSpoiler(spoiler);