Slash Command Error - I have no idea why
current problem is between data.js in command folder and index.js
There are 2 problem.
First is
it seem like it cant database property in index? and get data from data folder?
Second is I do not know what wrong with my data.js?
console log:
Warning: Accessing non-existent property 'database' of module exports inside circular dependency
10 Replies
- 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 OPfixed first one, still no have idea why invalid form body
Lastest code
Error log:
Looks like you arent passing anything into
await existingCommand.edit();
which would explain why your payload to register the command is completely undefinedhow can i fix it, is there any example
I would just pass in the edits as an object
i change
client.application.commands.set(commands);
to client.application.commands.set(commands.map(c => c.data));
and it work...
but now i have new error
@TAEMBOO you can check this sourceIt looks like you're just trying to register the entire contents of each command, including its execute function
uhh i have no idea, let me try rewrite it