需要帮助找到我错了DiscordJS



与bot没有任何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);

you在最后一个"else "后面缺少一个'}'声明。这应该可以工作

相关内容

最新更新