-1

I'm working on a bot that detects words like 'communism' and 'socialism' in my discord server (it's an inside joke) but I keep encountering a error saying 'syntaxError: Unexpected end of input'. If anyone could tell me why I am experiencing this error, and how to fix it, it would be greatly appreciated. Here is my code so far:

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 === 'communism') {
    msg.reply('ISM SPOTTED')
  } else if(msg.content === 'socialism') {
    msg.reply('ISM SPOTTED')
  } else if(msg.content === 'capitalism') {
    msg.reply('ISM SPOTTED')
  } else if(msg.content === 'sexism') {
    msg.reply('ISM SPOTTED')
  } else if(msg.content === 'racism') {
    msg.reply('ISM SPOTTED')
  } else if(msg.content === 'fascism') {
    msg.reply('ISM SPOTTED')
  } else if(msg.content === 'naxism') {
    msg.reply('ISM SPOTTED')
  } else if(msg.content === 'marxism') {
    msg.reply('ISM SPOTTED')
};

client.login('[my token]');
0

1 Answer 1

0

Change:

  } else if(msg.content === 'marxism') {
    msg.reply('ISM SPOTTED')
};

to this:

  } else if(msg.content === 'marxism') {
    msg.reply('ISM SPOTTED')
  }
});

You are missing a closing parenthesis and curly brace.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.