Parsing Error: Unexpected Token?


#1

Heya,
So, I have started a new project for my discord bot and for some reason an error pops up when I do “bot.login(process.env.TOKEN);”. The error is: “Parsing error: Unexpected token” and even after I delete that line it still appears. It works on my other discord bot project, but not on this one. Here is the full code:

const Discord = require(‘discord.js’);
const bot = new Discord.Client();

bot.on(‘message’, async (message) => {
let prefix = “!”;
const [cmd, …args] = message.content.split(/\s+/g);

if(message.includes === “dab”) {
message.channel.send("<o/")

};

bot.login(process.env.TOKEN);

Also here is the error message in the logs:

SyntaxError: Unexpected end of input
4:04 PM
at createScript (vm.js:80:10)
4:04 PM
at Object.runInThisContext (vm.js:139:10)
4:04 PM
at Module._compile (module.js:616:28)
4:04 PM
at Object.Module._extensions…js (module.js:663:10)
4:04 PM
at Module.load (module.js:565:32)
4:04 PM
at tryModuleLoad (module.js:505:12)
4:04 PM
at Function.Module._load (module.js:497:3)
4:04 PM
at Function.Module.runMain (module.js:693:10)
4:04 PM
at startup (bootstrap_node.js:191:16)
4:04 PM
at bootstrap_node.js:612:3

Additional Information: The bot’s token is in the .env file already


#2

Let us know the project name and we’ll take a look. If your project is private, either make it public temporarily or DM me a join link so we can view the code. Thanks


#3

You opened two functions (bot.on(‘message’, async (message) => { and if(message.includes === “dab”) {), but you only closed one. Add another } at the end.

Also, that code contains “fancy quotes” (“ ” and (‘ ’), but you can only use normal quotes (" " or ' ').