How to respond image for autocomplete?
Hi, I'm trying to build a similar discord bot with a slash command just like as a default one called "giphy"
As you can see by trying '/giphy', as you type in some strings, you get the reponse containing arrays of images.
As far as i know the responses should look like [{name:"Choice 1", value: "1"}, {name:"Choice 2", value: "2"}, ... , ].
and the users see names of each object.
I tried to use canvas "@napi-rs/canvas" in order to embed image in the 'name' of respond, instead of string. However, I was not able to achieve what I expect.
Can anyone please help me out?
9 Replies
- 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!autocomplete only supports strings
Then I was wondering how does the giphy command still respond with preview of gif files? aren't they still using images other than string?
the giphy is built in
ask discord
@wolvinny🌈 asked discord and they answered me to come here lol
they likely sent you back because we're able to help you with using
discord.js
to handle application commands
that being said, the giphy command is built in and is not an application command
therefore it doesn't go through the bot api
there is no feature within the bot api that allows you to show images through autocomplete@duck Thank you for the help! Is there any selection options for showing list of image tho?
not really, no
@duck Okay, I'll try for other way to solve this 🙂