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
d.js toolkit
d.js toolkit16mo 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!
treble/luna
treble/luna16mo ago
autocomplete only supports strings
Jimmy_DB
Jimmy_DBOP16mo ago
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?
treble/luna
treble/luna16mo ago
the giphy is built in ask discord
Jimmy_DB
Jimmy_DBOP16mo ago
@wolvinny🌈 asked discord and they answered me to come here lol
duck
duck16mo ago
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
Jimmy_DB
Jimmy_DBOP16mo ago
@duck Thank you for the help! Is there any selection options for showing list of image tho?
duck
duck16mo ago
not really, no
Jimmy_DB
Jimmy_DBOP16mo ago
@duck Okay, I'll try for other way to solve this 🙂
Want results from more Discord servers?
Add your server