Skip to main content
Version: Next

RESTAPIAttachment

This structure is used in Message Create and Edit requests to set which attachments are in the message and provide their metadata.

When editing, you must provide the id of each file to keep, and you can optionally update the description and is_spoiler fields of existing attachments.

@see

Index

Properties

optionaldescription

description?: string

Description (alt text) for the file (max 1024 characters)

optionalduration_secs

duration_secs?: number

The duration of the audio or video file (required for voice messages)

optionalfilename

filename?: string

Name of file attached

id

id: string | number

Attachment id, for new attachments this must match the n in files[n]

optionalis_spoiler

is_spoiler?: boolean

Whether the attachment should be marked as a spoiler and blurred until clicked, this sets the IS_SPOILER attachment flag

optionaltitle

title?: string

The title of the file

optionalwaveform

waveform?: string

Base64 encoded bytearray representing a sampled waveform (required for voice messages)