繁体   English   中英

需要帮助找到我哪里出错了 DiscordJS

[英]Need helping finding where i went wrong DiscordJS

与机器人混在一起没有任何 javascript 经验,所以我无法发现我哪里出错了,它说的是意外的标记并指向)最后我猜那不是问题而是其他问题

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

const {
    prefix,
    token
} = require('./config.json');

client.once('ready', () => {
    console.log('Online');
});

client.on('message', message => {

            const args = message.content.slice(prefix.length).trim().split(' ');
            const command = args.shift().toLowerCase();
            if (!message.content.startsWith(prefix) || message.author.bot) return;

            else if (command === 'bargun') {
                message.channel.send('bargun number one siege player I get wet when I hear his name');
            } else if (command === 'siege') {
                message.channel.send('Siege is Shit Game');
            } else if (command === 'shaiiko') {
                message.channel.send('Shaiiko is the coolest guy ever i want to be him')
            } else if (command === 'kruzty') {
                message.channel.send('Kruzty is a bitch');

            } else if (command === 'cunt') {
                if (!args.length) {
                    return message.channel.send(`${message.author} is a cunt`);
                    message.channel.send(`${command}\n${args} is a cunt.`);
                };



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

const {
    prefix,
    token
} = require('./config.json');

client.once('ready', () => {
    console.log('Online');
});

client.on('message', message => {

            const args = message.content.slice(prefix.length).trim().split(' ');
            const command = args.shift().toLowerCase();
            if (!message.content.startsWith(prefix) || message.author.bot) return;

            else if (command === 'bargun') {
                message.channel.send('bargun number one siege player I get wet when I hear his name');
            } else if (command === 'siege') {
                message.channel.send('Siege is Shit Game');
            } else if (command === 'shaiiko') {
                message.channel.send('Shaiiko is the coolest guy ever i want to be him')
            } else if (command === 'kruzty') {
                message.channel.send('Kruzty is a bitch');

            } else if (command === 'cunt') {
                if (!args.length) {
                    return message.channel.send(`${message.author} is a cunt`);
                    message.channel.send(`${command}\n${args} is a cunt.`);
                };
            }


            }); 
client.login(token);

你在最后一个“else if”语句之后缺少一个'}'。 这应该工作

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM