Cannot read data and .toJSON

C:\Users\Bernardo\Desktop\berrie\main.js:37 for (const command of commands) { commandArray.push(client.commands.get(command).data.toJSON()); } ^ TypeError: Cannot read properties of undefined (reading 'data') at client.pushcmds (C:\Users\Bernardo\Desktop\berrie\main.js:37:82) at C:\Users\Bernardo\Desktop\berrie\dashboard\dash.js:35:30 at Layer.handle [as handle_request] (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\layer.js:95:5) at next (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\route.js:149:13) at Route.dispatch (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\route.js:119:3) at Layer.handle [as handle_request] (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\layer.js:95:5) at C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\index.js:284:15 at param (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\index.js:365:14) at param (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\index.js:376:14) at Function.process_params (C:\Users\Bernardo\Desktop\berrie\node_modules\express\lib\router\index.js:421:3)
2 Replies
d.js toolkit
d.js toolkit2mo 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 staff
Berrie
Berrie2mo ago
anyone able to help? berrie@1.0.0 C:\Users\Bernardo\Desktop\berrie └── discord.js@14.15.2 PS C:\Users\Bernardo\Desktop\berrie> node -v v22.2.0 its solved! I've had some deleted cmd in guilds.json but ty for the response!
Want results from more Discord servers?
Add your server
More Posts
registration stepper/wizardI want to make a registration stepper/wizard how do i create this using Discord.js i want to have a If I receive two messages on the same channel, I want to be able to retrieve both of them separatelyI pressed the wrong button. I am reposting. Sorry for the long title. I would like to do exactly whaIf I receive two messages on the same channel, I want to be able to retrieve both of them separatelySorry for the long title. I have been doing JS for a year or two and I am still a beginner. I would An invalid token was provided.I reseted my token and i did put in my config.json ```json { "token_secret":"" } ``` ```js consChange Role icon (Emoji)I want to change the icon for a specific roll with an emoji. I'm trying to do that, but I'm getting How can i add no prefix system into my bot??I have to create a full no prefix system along with no prefix add remove list command how can i do tBot responding with 2 or 3 messages instead of 1 after being not used for a whilehi, anyone can help me? i have an guildMemberAdd event to welcome my new members on server which senProperty 'getMessage' does not existHello, I've just updated to the latest version of discord.js and I can't seem to access the getMessaRecurring EventsI'm putting my guild events onto a website calendar, but I'm having a hard time dealing with recurriError when trying to upload global slash commandsI have no idea why I am getting this error. When I register slash commands locally everything works