I'm new at coding so please help

yeah so I’m new at coding and i don’t know what is wrong so please help

}
if(message.content === “message”) {
let embedmsg = new Discord.MessageEmbed()
.setColor(‘any color’)
.setTitle(‘Title’)
.setDescription(‘Description’)
message.channel.send(embedmsg);
}
})

client.login(process.env.BOT_TOKEN);

my problem is the } }) thing how can i fix it?

Do you have any errors?

It’s possible that your number of opening and closing parens () and braces {} don’t match up – to check, we would need to see some more context. Can you post a bigger chunk of your code that shows where all the sections start?

1 Like

It looks like you are trying to end the file after this command. If there are more commands after this one, then you should remove the }). Also for .setColor you are going to want to put an actual color, otherwise it will throw an error. Here is a color to use for now. .setColor(0x7289da)

yeah it’s the }
})

if(message.content === “bby kick”)) {
if(message.member.hasPermission(“KICK_MEMBERS”)) {
let(member = message.mentions.members.first()
if(!member) message.channel.send(“Please mention someone”)
else {
member.kick().then (mem => {
message.channel.send(Kicked ${mem.user.username}!)
})
}
} else {
message.reply(“You do not have permission to do that.”)
}
if(message.content === “bby rules”)
let embedmsg = new Discord.MessageEmbed()
.setColor(‘O57F7C’)
.setTitle(‘Title’)
.setDescription(‘Description’)
message.channel.send(embedmsg);
}
})

client.login(process.env.BOT_TOKEN);

Line 1 has an additional close paren it doesn’t need.
Line 3, let(member should just be let member
Line 7, you need backticks around Kicked ${mem.user.username}! (Backticks are these: ``)
Line 14, you need an open brace after the if statement because the block is multiple lines
if(message.content === “bby rules”) {
I think you’re missing a close brace at line 15

There might be more problems, it’s hard to tell without running it.

Fixed code:

if(message.content === "bby kick") {
	if(message.member.hasPermission("KICK_MEMBERS")) {
		let member = message.mentions.members.first()
		if(!member) message.channel.send("Please mention someone")
		else {
			member.kick().then(mem => {
				message.channel.send(`Kicked ${mem.user.username}!`);
			})
		}
	}
	else
	{
		message.reply("You do not have permission to do that.")
	}
}

if(message.content === "bby rules")
{
	let embedmsg = new Discord.MessageEmbed()
		.setColor('O57F7C')
		.setTitle('Title')
		.setDescription('Description')
	message.channel.send(embedmsg);
}

client.login(process.env.BOT_TOKEN);

An extra tip, use triple backticks when you’re embedding code in a forum post ``` and it will format it like above.

Hope it helps! :fire_engine:

Ste

1 Like

An extra tip, use triple backticks when you’re embedding code in a forum post ``` and it will format it like above.

I personally use ```js as that makes it format with JavaScript syntax

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.