Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/363.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 我的机器人不和谐';不行。我不知道';我不知道为什么?_Javascript_Discord - Fatal编程技术网

Javascript 我的机器人不和谐';不行。我不知道';我不知道为什么?

Javascript 我的机器人不和谐';不行。我不知道';我不知道为什么?,javascript,discord,Javascript,Discord,这是机器人不和谐的代码!我有一个错误,我修不好,请帮帮我。 我在这里找到了代码 错误是 /volume1/web/anju.my bot.fun/index.js:99 }); 谢谢代码缺少一个右大括号,因此在语法上无效。检查每个街区是否都在你想结束的地方结束。我不知道你的意图。看起来大括号就在最后一个右括号之前丢失了,但我不能确定这是否会给出您所需要的逻辑。@ArthurGorbana只需在结尾处的)前添加1}检查这个--也许它会起作用。同样,如果它不起作用,你必须自己检查你的代码,我们不知道

这是机器人不和谐的代码!我有一个错误,我修不好,请帮帮我。 我在这里找到了代码

错误是

/volume1/web/anju.my bot.fun/index.js:99 });


谢谢

代码缺少一个右大括号,因此在语法上无效。检查每个街区是否都在你想结束的地方结束。我不知道你的意图。看起来大括号就在最后一个右括号之前丢失了,但我不能确定这是否会给出您所需要的逻辑。@ArthurGorbana只需在结尾处的)前添加1}检查这个--也许它会起作用。同样,如果它不起作用,你必须自己检查你的代码,我们不知道你想要它做什么。THX问题解决了
    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;
    }
  }
);