Ask coding questions

← Back to all posts
Help with code
Bottian (1)

whenever I run the code it pops up with an unexpected end of input on the final line. any help would be appreciated as I already tried to fix this in several ways. thanks

Comments
hotnewtop
Coder100 (18920)

here is the error
you forgot the }); for the client.on message.
Here is the correct code for line 45-50

client.on('message', message => {
if (msg.content.startsWith(".Milestones")) {
    db.get("Milestones").then(Milestones => {
      msg.channel.send(Milestones)
})
}
});
Bottian (1)

umm I still get the syntax error on line 70
@Coder100

Coder100 (18920)

@Bottian line 21-27

db.get("Milestones").then(Milestones => {
  console.log(Milestones)
  client.on('message', message => {
  if (!Milestones || Milestones.length < 1) {
    db.set("Milestones", starterMilestones)
  }  
})
})

you also forgot another }).

Next time maybe try formatting your code better so these errors won't happen