Discord.js unable to login after using Client#destroy()

纵饮孤独 提交于 2021-02-05 08:00:47

问题


switch (command[0])
{
  case 'restart':
    if(msg.author.id == config["owner"]){
      msg.channel.send(preEmbed('clientRestart'));
      client.destroy();
      client.login(config["token"]);
    }
    break;
}

this causes the error DiscordjsError: Request to use token, but token was unavailable to the client.

anyone know the cause / fix?


回答1:


According to discord.js' github repo, you get that message when you don't provide a token, so make sure you are providing the token correctly.



来源:https://stackoverflow.com/questions/60967485/discord-js-unable-to-login-after-using-clientdestroy

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!