type error : la commande pingn'a pas de nom

const fs = require ("fs") module.exports = async bot => { fs.readdirSync ("./Commandes").filter(f => f.endsWith(".js")).forEach(async files => { let command = require(../Commandes/${files}) if(command.name || typeof command.name !== "string") throw new TypeError(La commande ${files.slice(0, files.length - 3 )} n'a pas de nom ! ) bot.commands.set(command.name, command) console.log(Commande${file} chargée avec succés !) }) }
15 Replies
d.js toolkit
d.js toolkit13mo ago
- 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 staff
chewie
chewie13mo ago
Please keep it english.
treble/luna
treble/luna13mo ago
and it appears like one of your commands does not have or export a name property
FenixRiser
FenixRiserOP13mo ago
i am french
treble/luna
treble/luna13mo ago
this server is english
FenixRiser
FenixRiserOP13mo ago
yes I know but can you help me with the code?
treble/luna
treble/luna13mo ago
. this isnt really djs related either
FenixRiser
FenixRiserOP13mo ago
PLS
treble/luna
treble/luna13mo ago
i told you what your issue is you just have to read
FenixRiser
FenixRiserOP13mo ago
sorry google traductiuon didn't translate me like that my problem is the title of this post
treble/luna
treble/luna13mo ago
and your solution is right here
FenixRiser
FenixRiserOP13mo ago
what should I change?
treble/luna
treble/luna13mo ago
make your command export a name and/or make sure you set one this is not djs related, rather basic js
FenixRiser
FenixRiserOP13mo ago
I don't really know how to make a bot I just watched a tutorial and there is a problem there so I don't know how to change the code to correct it
treble/luna
treble/luna13mo ago
#rules 3 #resources then
Want results from more Discord servers?
Add your server