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