I am a beginner at Node.js Coding and recently coded my bot on repl.it I know that there is something wrong with this code and cannot understand where should I put '{' Can you please help me <3 Here is my code:
client.on("message", async (message) => {
if(message.content.startsWith("!warn"))
let victim = message.mentions.users.first()
if(!victim) message.reply("mention someone to warn.")
else {
let embed = new Discord.MessageEmbed()
.setTitle("Warnings")
.setDescription(`${victim} got warned by ${message.author}!`)
.setColor("GREEN")
.setFooter(`Moderator : ${message.author.username}`)
.setTimestamp()
message.channel.send(embed)
}
});
If there are some questions ask it I will really appreciate it if you will help! <3
Can you please send the final version of this code
if(message.content.startsWith("!warn"))and a closing curly bracket before});. Please do make sure to learn some basic JavaScript before hopping into Discord.js Development. It is highly recommended to do so and would help you a lot while debugging your code rather than coming on a support site for such a minor issue (Sorry if I'm being a bit rude).