0

I am trying to run a discord bot and it says that there is an "Unexpected end of input" when i try to run it. Here is the code:

const Discord = require('discord.js');
const client = new Discord.Client();

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('message'), msg => {
  if (msg.content === 'ree') {
    message.author.kick("FURRY SLUR")
};
 client.login('token');

And here is the error

SyntaxError: Unexpected end of input
    at Module._compile (internal/modules/cjs/loader.js:721:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

2 Answers 2

3

You're missing a closing });, just right before the login function.

client.on('message', msg => {
  if (msg.content === 'ree' && msg.guild && msg.member.kickable) {
    msg.member.kick('FURRY SLUR')
      .catch(console.error);
  }
});

client.login('token');
Sign up to request clarification or add additional context in comments.

1 Comment

You need to ) after message
0

You've closed your on prematurely, and you haven't closed the if.

client.on('message', msg => {
  if (msg.content === 'ree') {
    message.author.kick("FURRY SLUR");
  }
});

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.