Skip to content

MessageAttachment

MessageAttachment

Represents a message attachment.

Kind: global class

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.

messageAttachment.setFile(file) ⇒ MessageAttachment

Sets the file for the attachment.

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

ParamTypeDescription
fileBufferResolvable | StreamThe file to attach.

messageAttachment.setFilename(filename) ⇒ MessageAttachment

Sets the name of the file.

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

ParamTypeDescription
filenamestringThe name of the file.

messageAttachment.setDescription(description) ⇒ MessageAttachment

Sets the description of the attachment.

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

ParamTypeDescription
descriptionstringThe description of the attachment.

messageAttachment.setSpoiler() ⇒ MessageAttachment

Sets the attachment as a spoiler.

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