Skip to content

Commit c0cc02d

Browse files
authored
Update interactionAttachment.js (#729)
1 parent d24a439 commit c0cc02d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/functions/components/interactionAttachment.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ module.exports = async d => {
55
const data = d.util.aoiFunc(d);
66
if (data.err) return d.error(data.err);
77

8-
const [ option ] = data.inside.splits;
8+
const [ optionName, optionToReturn = "url" ] = data.inside.splits;
99

10-
data.result = d.data.interaction.options.getAttachment(option.addBrackets()).url;
10+
data.result = d.data.interaction?.options.getAttachment(optionName.addBrackets())?.[optionToReturn];
1111

1212
return {
1313
code: d.util.setCode(data)
1414
}
15-
}
15+
}

0 commit comments

Comments
 (0)