Type error with ApplicationCommandType and ContextMenuCommandType

I just upgraded TypeScript and some other things in my package.json and it apparently now thinks that the following code is invalid:

new ContextMenuCommandBuilder()
    .setName('...')
    .setType(ApplicationCommandType.Message)
    // TS2345: Argument of type ApplicationCommandType. Message is not assignable to parameter of type ContextMenuCommandType


When checking the types ContextMenuCommandBuilder#setType() requires the type ContextMenuCommandType, which is resolved to ApplicationCommandType.Message | ApplicationCommandType.User.

So why are these types not compatible to each other? Is this possibly due to a version mismatch?

My versions:
"discord-api-types": "^0.37.101"
"discord.js": "^14.16.3"
"typescript": "^5.6.3"

Node: v22.9.0


Thanks in advance.
Was this page helpful?