Problems with the Export of modules in v14

Only one Funktion is getting executed and the other not, what can i do?
12 Replies
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers. - Issue solved? Press the button!
Yannik
YannikOP17mo ago
grass
grass17mo ago
show how you define client.commands
Yannik
YannikOP17mo ago
bot.commands = new Discord.Collection();
grass
grass17mo ago
and how do you fill that with commands
Yannik
YannikOP17mo ago
Its all on the first photo
grass
grass17mo ago
your code expects your command file to export an object, not an array of objects
Yannik
YannikOP17mo ago
How can i fix that?
grass
grass17mo ago
either export an object or adjust your code to handle arrays of objects
Yannik
YannikOP17mo ago
The file Name of the file is in this case not important, because the command handler looking for the name inside the export funktion Do you have an idea how I can adjust it to handle arrays of objects? Maybe anyone other? I want to group the commands in File, because i think its looks nicer and cleaner
DANIEL
DANIEL17mo ago
try separate 1 file = 1 command
PAdventures
PAdventures17mo ago
I thought Discord.Collection was deprecated oh. k nvm
Want results from more Discord servers?
Add your server