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

Did you find this page helpful?