"Unkown command" when using context command

so heres my code i've no idea why the context command says unkown command
Pastebin
const commands = [ new SlashCommandBuilder() .setName("dm") ...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
8 Replies
d.js toolkit
d.js toolkit5d 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
Auth
Auth5d ago
No description
souji
souji5d ago
context commands are still commands, so it enters the first branch and then the default rather than the else if if you want to check for slash commands, #isChatInputCommand is the guard for that
d.js docs
d.js docs5d ago
:method: BaseInteraction#isChatInputCommand() @14.16.2 Indicates whether this interaction is a ChatInputCommandInteraction.
Auth
Auth5d ago
Pastebin
async function handleInteraction(interaction) { // Check if the us...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Auth
Auth5d ago
else if like this?
souji
souji5d ago
stop doing, start reading your structure is
if iscommand:
...
else if is contextmenucommand:
...
if iscommand:
...
else if is contextmenucommand:
...
message context menu commands, are still commands so they will enter the first branch (if) and get lost in there, because none of the cases match if you just want to match against chat input commands, use this one instead
Auth
Auth5d ago
mb mb sorry WORKEDDD!!!!!!!11 ILYYY
Want results from more Discord servers?
Add your server