$getAttachments
$getAttachments will return the properties of an attachment.
Usage
$getAttachments[channelID;messageID;index?;option?;sep?]Parameters
| Field | Type | Description | Required |
|---|---|---|---|
| channelID | number | The channel of where the message is present in. | true |
| messageID | number | The message ID. | true |
| index? | number | Attachment index. | false |
| option? | string | The option to retrieve. | false |
| sep? | string | Separator used to join multiple values. Defaults to ", ". | false |
Options
| Options | Type | Description |
|---|---|---|
| contentType | string | Returns the media type of the attachment |
| description | string | Returns the description (alt text) of the attachment. |
| ephemeral | boolean | Returns true / false if whether the attachment is ephemeral. |
| height | number | Returns the height of the attachment (if it’s an image or video). |
| id | number | Returns the attachment’s ID. |
| name | string | Returns the name of the attachment. |
| proxyURL | string | Returns the Proxy URL of the attachment. |
| size | number | Returns the size of the attachment in bytes. |
| spoiler | boolean | Returns true / false if whether or not the attachment has been marked as a spoiler. |
| url | string | Returns the URL of the attachment. |
| width | number | Returns 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:
1client.command({2 name: "getAttachments",3 code: `4 $getAttachments[$channelID;$messageID;1;name]5 `6});