I've recently started a new discord.js bot, and got an 'invalid token' error. it cannot be because of an async function, because I've only started the bot and I have 0 commands, last time this has happened was when I was trying to host another bot on heroku.i have never found a solution to, here's my terminal:
C:\Users\Lory\Desktop\pp>node .
(node:3760) UnhandledPromiseRejectionWarning: Error [TOKEN_INVALID]: An invalid token was provided.
at WebSocketManager.connect (C:\Users\Lory\Desktop\pp\node_modules\discord.js\src\client\websocket\WebSocketManager.js:133:26)
at Client.login (C:\Users\Lory\Desktop\pp\node_modules\discord.js\src\client\Client.js:222:21)
(node:3760) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:3760) [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.
C:\Users\Lory\Desktop\pp>
The code that I am using:
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = '!'
client.on('ready', () => {
console.log('bot is ready');
});
client.login('token');

'token'with the token that you got from Discord?