问题
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