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 :
const Discord = require("discord.js")

module.exports = {

name: "test",
description: "test",
permission: "Aucune",
dm: false,
category: "Test",
options: [
{
type: "string",
name: "modele",
description: "Test",
required: true,
autocomplete: false
}
],

let modele = args.getString("modele"),

async run(msg) {
msg.say(`Le texte ecrit est: \`${modele}\``);
}
}
const Discord = require("discord.js")

module.exports = {

name: "test",
description: "test",
permission: "Aucune",
dm: false,
category: "Test",
options: [
{
type: "string",
name: "modele",
description: "Test",
required: true,
autocomplete: false
}
],

let modele = args.getString("modele"),

async run(msg) {
msg.say(`Le texte ecrit est: \`${modele}\``);
}
}
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 !`) }) }
No description
No description
14 Replies
d.js toolkit
d.js toolkit9mo 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!
shikoshib
shikoshib9mo ago
I guess you should define modele in run()
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
shikoshib
shikoshib9mo ago
try this @SynNoXx0
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
SynNoXx0
SynNoXx0OP9mo ago
like that ? `async run(modele, msg) { msg.say(`Le texte ecrit est: \`${modele}\); }
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs9mo ago
:guide: Home: Introduction - Before you begin... read more
SynNoXx0
SynNoXx0OP9mo ago
ok thanks
shikoshib
shikoshib9mo ago
async run(msg){
let modele = args.getString("modele");
msg.reply(`Le texte ecrit est: \`${modele}\``);
}
async run(msg){
let modele = args.getString("modele");
msg.reply(`Le texte ecrit est: \`${modele}\``);
}
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
shikoshib
shikoshib9mo ago
true tho 😵‍💫
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
SynNoXx0
SynNoXx0OP9mo ago
ok I will do that, thanks anyway
Want results from more Discord servers?
Add your server