"ApplicationCommandType.User" is not assignable to parameter of type "ContextMenuCommandType"

I'm using discord.js with Typescript and I encounter the error TS2345: Argument of type ApplicationCommandType.User is not assignable to parameter of type ContextMenuCommandType But if I look in the type definition I can see type ContextMenuCommandType = ApplicationCommandType.Message | ApplicationCommandType.User; Code
const commandType = ApplicationCommandType.User;
return new ContextMenuCommandBuilder()
.setType(commandType);
const commandType = ApplicationCommandType.User;
return new ContextMenuCommandBuilder()
.setType(commandType);
Versions - Node :white_right_arrow: 20.16.0 - discordjs :white_right_arrow: 14.16.3 - discord-api-types :white_right_arrow: 0.37.103 (installed as dev dependencies) - Typescript :white_right_arrow: 5.6.3
3 Replies
d.js toolkit
d.js toolkit3mo 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
treble/luna
treble/luna3mo ago
known bug, downgrade to 16.2 for the moment
Apokalypt
ApokalyptOP3mo ago
Oh, that was fast 😂 Thanks :WumpsHeartyLove:

Did you find this page helpful?