$interactionAttachment
$interactionAttachment
gets a specific attachment from an interaction and returns a property of it.
Usage
$interactionAttachment[optionName;optionToReturn?]
Parameters
Field | Type | Description | Required |
---|---|---|---|
optionName | string | Name of the option containing the attachment. | true |
optionToReturn? | string | The property of the attachment to return (e.g., url , name ). Default: url | false |
Example(s)
This will return the URL of the attachment from an interaction option named file
:
1client.command({2 name: "getAttachment",3 code: `4 $interactionAttachment[file]5 `6});
This will return the name of the attachment instead of the URL:
1client.command({2 name: "getAttachmentName",3 code: `4 $interactionAttachment[file;name]5 `6});