Creating slash commands

How do I create slash commands? Currently, I am just listening for messages and checking if the message is "/verify" but how do I make it an actual slash command? Thanks for any help 🙂
17 Replies
d.js toolkit
d.js toolkit•5mo 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 docs•5mo ago
Suggestion for @Mortai:guide Creating Your Bot: Creating slash commands read more
Mortai
Mortai•5mo ago
i tried that it didn't really work for me
treble/luna
treble/luna•5mo ago
define didnt work
Mortai
Mortai•5mo ago
nothing happened i followed the tutorial and no commands showed up
treble/luna
treble/luna•5mo ago
show your code
Mortai
Mortai•5mo ago
i deleted it cuz i tried ages ago ill try again rn and show code if it doesnt work ty
Koy
Koy•5mo ago
You also need to register them to show up
d.js docs
d.js docs•5mo ago
guide Creating Your Bot: Registering slash commands read more
Mortai
Mortai•5mo ago
i did im trying again rn it says i need to use collections what is equivalent to Array.push() but for Collection()?
treble/luna
treble/luna•5mo ago
set
d.js docs
d.js docs•5mo ago
method Collection#set() Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
Mortai
Mortai•5mo ago
will that push to the end? oh it uses keys and values
treble/luna
treble/luna•5mo ago
Collections are just Maps
Mortai
Mortai•5mo ago
ok the tutorial isnt working it adds the commands to a commands array but it tries to get them from a commands collection?
Unknown User
Unknown User•5mo ago
Message Not Public
Sign In & Join Server To View
Mortai
Mortai•5mo ago
i got it to work but that tutorial isnt great thanks guys