Async datas in command.data (SlashCommand)
Hey everyone !
I'm trying to register that new one command, actually that I want is to pass "interaction" in
data
with async method (code bellow).
For example, I want to get guild ID (then from interaction) to do some Prisma requests with that guild ID parameter and then update one dropdown select with results (from database).
But I get errors when reload my bot (error bellow too), any informations ?
Thanks 🙂
There is my index.js
file (with command register) :
4 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!This is not possible.
Depending on what you want to do, there might be a way.
It sounds like you want to look into
autocomplete
options I think.It's because you're doing
data
not data()
Also, await new? ☠️
And why are you passing interaction
in data?
The interaction does not exist in the command data
Physically impossibleOh, I'll look back my code when i'm home, thanks 🙂