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 toolkit2y 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
YannikOP2y ago
grass
grass2y ago
show how you define client.commands
Yannik
YannikOP2y ago
bot.commands = new Discord.Collection();
grass
grass2y ago
and how do you fill that with commands
Yannik
YannikOP2y ago
Its all on the first photo
grass
grass2y ago
your code expects your command file to export an object, not an array of objects
Yannik
YannikOP2y ago
How can i fix that?
grass
grass2y ago
either export an object or adjust your code to handle arrays of objects
Yannik
YannikOP2y 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
DANIEL2y ago
try separate 1 file = 1 command
PAdventures
PAdventures2y ago
I thought Discord.Collection was deprecated oh. k nvm
Want results from more Discord servers?
Add your server