Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.

There is no current way to take an image/attachment as an arg #279

Closed
comicallybad opened this issue Oct 1, 2019 · 4 comments
Closed

There is no current way to take an image/attachment as an arg #279

comicallybad opened this issue Oct 1, 2019 · 4 comments

Comments

@comicallybad
Copy link

If there is a way I am not sure of please I would love to hear it, but with the current package, I can find no way of accepting an image as an argument. I am making a bot which takes a user image input, to then put within a rich embed to send to another channel. I would like to stick with the packages way of multiple arguments, where in the channel it is one after the other, one at a time. But then this issue makes me take things outside of the package.

@GamesProSeif
Copy link

GamesProSeif commented Oct 1, 2019

If the image is attached to the message, you can access its details inside Message#attachments (stable | master), so that's a way to get an image as an argument.

I would recommend not using Github issues for general help on the library usage but using the Discord.js Official Discord server instead.
You'll have way more support there. Good luck!

Edit: I thought this was discordjs/discord.js repo and not Commando. I apologize for the conflict.

@comicallybad
Copy link
Author

All good. Like I definitely know of ways I can get ahold of the image. But for convenience sake, having a type "attachment" for arguments would force me to basically recode what is already coded to just allow for an image. Because Now I will just have to do what the package does, send a message asking for the next argument in this case an image. Then await a response for 30 seconds. Then store that for the final rich embed message. So just inconvenient.

@dragonfire535
Copy link
Contributor

You can use https://github.com/dragonfire535/xiao/blob/master/types/image.js, but due to issues with prompting the type hasn't been added to Commando yet.

@dragonfire535
Copy link
Contributor

Using #367, you should be able to accept an image argument perfectly fine if you write your own argument to do so. The above link to Xiao's should work perfectly.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants