0

Here's the code that the error is in, the error is on the last line that you see here and i'm not sure how to solve it, I'm pretty new to all of this, so some advice would be useful. I need to solve this issue as quick as possible as we are using this bot as a moderation tool in one of my Discord servers. Thank you all!

   }
    
    if (command === "slap") {
         const options = [
             "https://tenor.com/view/no-angry-anime-slap-gif-7355956",
             "https://tenor.com/view/when-you-cant-accept-reality-slap-anime-gif-14694312",
             "https://tenor.com/view/anime-slap-slap-in-the-face-smash-gif-17314633"
        ]
        if (message.mentions.users.first()) {
            message.channel.send(message.author.username + " slapped " + message.mentions.users.first().username)
        } else {
            message.channel.send("You have to mention a user to slap")
        }
    }
        if (command === "shutdown") {
        if (message.content.toLowerCase() == "shutdown") { 
        }
        message.channel.send("Shutting down...").then(() => {
            bot.destroy();
    }
1
  • You're missing } and ) after the bot.destroy() call. Check that you have a closing parenthesis ) for each opening parenthesis (, and a closing bracket } for each opening bracket {. Commented Apr 28, 2021 at 16:27

1 Answer 1

1

You missed a closing ) and }, this is easier to see with formatting:

if (command === "slap") {
  const options = [
    "https://tenor.com/view/no-angry-anime-slap-gif-7355956",
    "https://tenor.com/view/when-you-cant-accept-reality-slap-anime-gif-14694312",
    "https://tenor.com/view/anime-slap-slap-in-the-face-smash-gif-17314633"
  ]
  if (message.mentions.users.first()) {
    message.channel.send(message.author.username + " slapped " + message.mentions.users.first().username)
  } else {
    message.channel.send("You have to mention a user to slap")
  }
}
if (command === "shutdown") {
  if (message.content.toLowerCase() == "shutdown") { 

  }
  message.channel.send("Shutting down...").then(() => {
    bot.destroy();
  })
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.