How to make a command handler for both prefix commands and slash commands

I'm building a bot for me and my friends and we both prefer the prefix commands for example !command over the slash commands, since discord.jsv12 is there anything I would have to change to make a command handler for that or would it still be the same in v14?
2 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!
SpecialSauce
SpecialSauce16mo ago
You could. You would just have to be able to parse the message to match the slash options. All error handling on malformed message commands are on you though which is one of the reasons slash commands are easier to work with. You would also have to figure out when you’re send()ing and when you’re reply()ing. <#1091914023404052530>
Want results from more Discord servers?
Add your server