Skip to content

$getAttachments

$getAttachments will return the properties of an attachment.

Usage

$getAttachments[channelID;messageID;index?;option?]

Parameters

FieldTypeDescriptionRequired
channelIDnumberThe channel of where the message is present in.true
messageIDnumberThe message ID.true
index?numberAttachment index.false
option?stringThe option to retrieve.false

Options

OptionsTypeDescription
contentTypestringReturns the media type of the attachment
descriptionstringReturns the description (alt text) of the attachment.
ephemeralbooleanReturns true / false if whether the attachment is ephemeral.
heightnumberReturns the height of the attachment (if it’s an image or video).
idnumberReturns the attachment’s ID.
namestringReturns the name of the attachment.
proxyURLstringReturns the Proxy URL of the attachment.
sizenumberReturns the size of the attachment in bytes.
spoilerbooleanReturns true / false if whether or not the attachment has been marked as a spoiler.
urlstringReturns the URL of the attachment.
widthnumberReturns the width of the attachment (if it’s an image or video).

Example(s)

This will return the name of the first attachment from the message that executed the command:

1
client.command({
2
name: "getAttachments",
3
code: `
4
$getAttachments[$channelID;$messageID;1;name]
5
`
6
});