SyntaxError: Unexpected token 'if'

SyntaxError: Unexpected token 'if'

var Eris = require('eris')
var bot = new Eris("########")                        

bot.on("ready", () =>(
    console.log("to vivo pai ihihihi")
));

bot.on("messageCreate"), (msg) => (
    if(msg.content.indexof(!ajuda) == 0) {
        bot.createmessage(msg.channel.id, "123")
    }
)); 

bot.connect()

i'm newbie to javascript and i was having this error can someone help me? (i'm using eris) PS:the "new Eris("########")" was supposed to be a token but i censored him

你使用了括号,而它应该是箭头函数的大括号:

bot.on("messageCreate"), (msg) => { // <--- curly brace, not parens
    if(msg.content.indexof(!ajuda) == 0) {
        bot.createmessage(msg.channel.id, "123")
    }
}); // <---- again, curly brace, not parens