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 toolkit6mo 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 🌈
chewie 🌈6mo ago
Please keep it english.
treble/luna
treble/luna6mo ago
and it appears like one of your commands does not have or export a name property
FenixRiser
FenixRiser6mo ago
i am french
treble/luna
treble/luna6mo ago
this server is english
FenixRiser
FenixRiser6mo ago
yes I know but can you help me with the code?
treble/luna
treble/luna6mo ago
. this isnt really djs related either
FenixRiser
FenixRiser6mo ago
PLS
treble/luna
treble/luna6mo ago
i told you what your issue is you just have to read
FenixRiser
FenixRiser6mo ago
sorry google traductiuon didn't translate me like that my problem is the title of this post
treble/luna
treble/luna6mo ago
and your solution is right here
FenixRiser
FenixRiser6mo ago
what should I change?
treble/luna
treble/luna6mo ago
make your command export a name and/or make sure you set one this is not djs related, rather basic js
FenixRiser
FenixRiser6mo 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/luna6mo ago
#rules 3 #resources then