Closed virtual-designer closed 1 month ago
Sort of duplicate of #10533, already resolved, wait for the next release.
Sort of duplicate of #10533, already resolved, wait for the next release.
Ah, my bad, I didn't look into the previously closed issues. Nevermind.
Which package is this bug report for?
builders
Issue description
It seems like in the latest version, the parameter type of the
ContextMenuCommandBuilder#setType()
method has been changed, which is now causing type errors when passingApplicationCommandType.Message
orApplicationCommandType.User
. Passing literal values like2
or3
works, though.The issue seems to be a bit weird, there are two
ApplicationCommandType
s defined, because the package@discordjs/builders
apparently has its owndiscord-api-types
installation which I found out by looking into thenode_modules
directory. So the project'sdiscord-api-types
and@discordjs/builders
's version ofdiscord-api-types
.It should be noted that the main project had only two dependencies:
discord.js@14.16.4
andtypescript
. Thediscord-api-types
that's right inside thenode_modules
directory of the project is what I'm referring to as "project's owndiscord-api-types
. And the otherdiscord-api-types
was atnode_modules/@discordjs/builders/node_modules/discord-api-types
.I also noticed the versions of both
discord-api-types
package were different, which is why the package manager probably installed two versions ofdiscord-api-types
.So in short, in both packages the definitions for
ApplicationCommandType
are the same, however, TypeScript kind of behaves like a nominal type system when using enums, so it doesn't seem to like multiplediscord-api-types
at once. The solution would probably be to upgrade the version ofdiscord-api-types
in@discordjs/builders
so that the package manager doesn't need to install multiple versions.Please correct me if any of the things I've said are wrong.
Code sample
Versions
Issue priority
Medium (should be fixed soon)
Which partials do you have configured?
Not applicable
Which gateway intents are you subscribing to?
Not applicable
I have tested this issue on a development release
No response