Skip to content

MessageAttachment

Represents a message attachment.

Kind: global class

new MessageAttachment(url, data, filename)

Section titled “new MessageAttachment(url, data, filename)”

Constructs a new MessageAttachment object.

ParamTypeDescription
urlstringThe URL of the attachment.
dataObjectAdditional data for the attachment.
filenamestringThe name of the file.

Sets the file for the attachment.

Kind: instance method of MessageAttachment
Returns: MessageAttachment - This attachment.

ParamTypeDescription
fileBufferResolvable | StreamThe file to attach.

Sets the name of the file.

Kind: instance method of MessageAttachment
Returns: MessageAttachment - This attachment.

ParamTypeDescription
filenamestringThe name of the file.

Sets the description of the attachment.

Kind: instance method of MessageAttachment
Returns: MessageAttachment - This attachment.

ParamTypeDescription
descriptionstringThe description of the attachment.

Sets the attachment as a spoiler.

Kind: instance method of MessageAttachment
Returns: MessageAttachment - This attachment.