npx create-discord-bot generates broken code

I'm picking up Discord.JS in order to expand my choices for clients, so I figured I should take a look at Discord.JS, however when i run npx create-discord-bot and say yes to Typescript, it will create a project with broken code in src/util/deploy.ts it says Argument of type 'RESTPostAPIApplicationCommandsJSONBody[]' is not assignable to parameter of type 'RESTPutAPIApplicationCommandsJSONBody on const result = await api.applicationCommands.bulkOverwriteGlobalCommands(process.env.APPLICATION_ID!, commandData);, its the commandData part that is showing the issue, I have no clue how or why this happens, for context I originally come from Discord.NET which pretty much hides away the entire command registering behind its RegisterCommandsGloballyAsync function
4 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!
The Fog from Human Resources
sure thing
+-- @discordjs/[email protected]
| +-- @discordjs/[email protected]
| +-- @discordjs/[email protected]
| | `-- [email protected] deduped
+-- @discordjs/[email protected]
+-- @discordjs/[email protected]
+-- @discordjs/[email protected]
| +-- @discordjs/[email protected]
| +-- @discordjs/[email protected]
| | `-- [email protected] deduped
+-- @discordjs/[email protected]
+-- @discordjs/[email protected]
Aight great! Not at my pc rn so I can't check, I do that in the package.json file right? Also thanks! :soPortuguese: i added the thingie earlier and ran a clean install via cli after deleting the packages folder to ensure a clean install but the same error happened with verion 0.37.100 :thinker:
hueman
hueman4d ago
I wonder if it would be helpful to include create-discord-bot as an option in the discord.js guide - I had no idea it existed tbh
The Fog from Human Resources
sorry wasnt available yesterday, this is what it logs:
+-- @discordjs/[email protected]
| +-- @discordjs/[email protected]
| +-- @discordjs/[email protected]
| | `-- [email protected] deduped
+-- @discordjs/[email protected]
+-- @discordjs/[email protected]
+-- @discordjs/[email protected]
| +-- @discordjs/[email protected]
| +-- @discordjs/[email protected]
| | `-- [email protected] deduped
+-- @discordjs/[email protected]
+-- @discordjs/[email protected]
seems to be the same for some reason ah wait resolutions is for yarn i put overrides there and now it seems to work :soPortuguese:
Want results from more Discord servers?
Add your server