I have an error in my code that I don't understand.
Good evening, I have an error in my code that I don't understand. I have already tried several times to modify my code but I still can't do it. What I'm trying to do is that when the user fills out the options the bot responds to the command with a message that contains what the user wrote. Thanks in advance.
here is the code for the command :
in the terminal the error speaks of the LoadCommands code so I put it there too:
``const fs = require("fs")
module.exports = async bot => {
fs.readdirSync("./Commandes").filter(f => f.endsWith(".js")).forEach(async file => {
let command = require(
../Commandes/${file})
if(!command.name || typeof command.name !== "string") throw new TypeError(
La commande ${file.slice(0, file.length - 3)} n'a pas de nom !)
bot.commands.set(command.name, command)
console.log(
Commande ${file} chargée avec succés !`)
})
}14 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!I guess you should define modele in run()
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
try this @SynNoXx0
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
like that ?
`async run(modele, msg) {
msg.say(`Le texte ecrit est: \`${modele}\
);
}Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
ok thanks
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
true tho
😵💫
Unknown User•9mo ago
Message Not Public
Sign In & Join Server To View
ok I will do that, thanks anyway