Unexpected token `const`

Hey, this showed up.
I searched in multiple sources, can’t find answer.
const embed = new Discord.RichEmbed()

SyntaxError: Unexpected token ‘const’
Could you help?

Hey @DaRealMiniToon, can you post a part of your code???

Hi. Show me your code completely. And try replacing const with var

Replacing const with var might not have any significant change except that you’ll have too many variables with higher scope for no reason.

indent preformatted text by 4 spaces
} else if (command == (help) )
const embed = new Discord.RichEmbed()
.setTitle(‘Some title’)
.setAuthor(‘ZombieTech782#9745’, ‘Logo here’, ‘Website here’)
.setDescription('Prefix : ! ')
.setThumbnail(‘Image Here’)
.addField(‘Moderation’, ‘!prune (number), !ban @User , !kick @user.’)
.addField(‘Information Commands’, '!server, !avatar ', true)
.addField(‘Fun Commands’, ‘!beep , !ping, hi .’, true)
.addField(‘Currency / Food’, ‘!order (food)’, true)
.setImage(‘Image link here’)
.setFooter(‘Some footer text here’, ‘Image link here’);




Just be sure not to share your token.

Okay, thanks! Hmmmm.

But could you help? oook.

@DaRealMiniToon After } else if (command == ( help ) ) you need to add a { to start the else if statement :slight_smile: As it wants that instead of const it gets confused when const comes up instead of the bracket
Hope this helps,

1 Like

Aaah, I was a bit too late :slight_smile:

Mhm @khalby786 But you could check my new post!

Oh, okay, thanks!  

Nice username @DaRealMiniToon

1 Like