Get image as arg from message

Is it possible to get the sended image from a command as an argument and send it with the bot? Like: !image (I send an image) And the bot sends the same image.
6 Replies
d.js toolkit
d.js toolkit14mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
d.js docs
d.js docs14mo ago
property Message#attachments A collection of attachments in the message - e.g. Pictures - mapped by their ids. (more...)
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
Moon
MoonOP14mo ago
if (message.attachments.size > 0) { const attachment = message.attachments.first(); message.reply({ files: [attachment.url] }); } Like this?
Unknown User
Unknown User14mo ago
Message Not Public
Sign In & Join Server To View
Moon
MoonOP14mo ago
It works, ty.
Want results from more Discord servers?
Add your server