Skip to content

$interactionAttachment

$interactionAttachment gets a specific attachment from an interaction and returns a property of it.

Usage

$interactionAttachment[optionName;optionToReturn?]

Parameters

FieldTypeDescriptionRequired
optionNamestringName of the option containing the attachment.true
optionToReturn?stringThe property of the attachment to return (e.g., url, name). Default: urlfalse

Example(s)

This will return the URL of the attachment from an interaction option named file:

1
client.command({
2
name: "getAttachment",
3
code: `
4
$interactionAttachment[file]
5
`
6
});

This will return the name of the attachment instead of the URL:

1
client.command({
2
name: "getAttachmentName",
3
code: `
4
$interactionAttachment[file;name]
5
`
6
});