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