We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d24a439 commit c0cc02dCopy full SHA for c0cc02d
src/functions/components/interactionAttachment.js
@@ -5,11 +5,11 @@ module.exports = async d => {
5
const data = d.util.aoiFunc(d);
6
if (data.err) return d.error(data.err);
7
8
- const [ option ] = data.inside.splits;
+ const [ optionName, optionToReturn = "url" ] = data.inside.splits;
9
10
- data.result = d.data.interaction.options.getAttachment(option.addBrackets()).url;
+ data.result = d.data.interaction?.options.getAttachment(optionName.addBrackets())?.[optionToReturn];
11
12
return {
13
code: d.util.setCode(data)
14
}
15
-}
+}
0 commit comments