这是bot discord的代码!我有一个错误,我无法修复,请帮助我。 我在这里https://maah.gitbooks.io/discord-bots/examples/restarting-and-shutting-down.html
找到了代码 client.on('message', message => {
if (message.channel.type != 'text' || message.author.bot)
return;
let command = message.content.split(' ')[0].slice(1);
let args = message.content.replace('.' + command, '').trim();
let isBotOwner = message.author.id == '554593664081461248';
//console.log(command);
switch (command) {
case 'restart': {
if (!isBotOwner)
return;
message.channel.send('Restarting...').then(m => {
client.destroy().then(() => {
client.login('token');
});
});
break;
}
case 'shutdown': {
if (!isBotOwner)
return;
message.channel.send('Shutting down...').then(m => {
client.destroy();
});
break;
}
}
);
错误是
/volume1/web/anju.my-bot.fun/index.js:99 });
谢谢