The example code on https://discord.js.org produces an UnhandledPromiseRejectionWarning.
const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});
client.login('token');
Produces
(node:98840) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Incorrect login details were provided.
(node:98840) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
This is not an issue on our end- it simply means the provided token is wrong. Feel free to discuss farther on the Discord server if you are having difficulty locating the correct token, we can try our best to help.
Issue was a result of an incorrect token.
He's got fingers of fury! 馃槃 Thanks for the help.
before moving to a less-persistent discussion form, where do we find the token that is missing in this issue? For example, I'm getting this error too, and found my token at https://discordapp.com/developers but my token was called a "Client Secret" so I suppose that's not where you get the correct token, but it does demonstrate how to share where the correct token could be found if anyone knows where to find it.

Most helpful comment