#type error : la commande pingn'a pas de nom

20 messages · Page 1 of 1 (latest)

sonic flower
#

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 !)
})
}

naive sundialBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
hollow plume
#

Please keep it english.

grizzled bolt
#

and it appears like one of your commands does not have or export a name property

sonic flower
#

i am french

grizzled bolt
#

this server is english

sonic flower
#

yes I know but can you help me with the code?

grizzled bolt
#

this isnt really djs related either

sonic flower
grizzled bolt
#

i told you what your issue is

#

you just have to read

sonic flower
#

sorry google traductiuon didn't translate me like that

#

my problem is the title of this post

grizzled bolt
sonic flower
#

what should I change?

grizzled bolt
#

make your command export a name

#

and/or make sure you set one

#

this is not djs related, rather basic js

sonic flower
#

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