我正在尝试使用Javascript编写不和谐的bot,但它总是说“预期的声明或声明。ts(1128)”

时间:2020-08-02 19:14:12

标签: javascript discord discord.js

这是代码,它说“ else”语句需要一个“ Declaration or statement” (.addfield()中的下划线实际上是单词,但我不希望有人窃取我的想法)

    if(command === 'start'){
        const embed = new Discord.MessageEmbed()
            .setTitle('START MENU')
            .addField('Options-')
            .addField('Hello and welcome to the world of pokémon! Pick your first pokémon from the list below with the command `p!pick <pokemon>`')
            .addField('Bulbasaur, Charmander, Squirtle')
            .addField('Chikorita, Cyndaquil, Totodile')
            .addField('Treecko, Torchic, Mudkip'
            .addField('Turtwig, Chimchar, Piplup')
            .addField('Snivy, Tepig, Oshawott')
            .addField('Chespin, Fennekin, Froakie')
            .addField('Rowlet, Litten, Popplio')
            .addField('Grookey, Scorbunny, Sobble')
            .addField('______,______,______')
            .setColor(0x036f5a))
        message.channel.send(embed)
    }}); else {
        message.channel.send('INVALID COMMAND')
    }

1 个答案:

答案 0 :(得分:0)

我会在else之前的双大括号,括号和分号上打2便士。 IMO,它应该只是一个大括号。