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