Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

265
Vistas
discord.js throws TOKEN_INVALID when I use the token I got from browser in discord.com

My final goal : I would like to get every single channels in every single guilds I belong to.

As a first step, created simple program that I identify that I am logged in as myself.

I first found my token via this video

In a nutshell the video instructs to get the token via

Chrome -> discord.com -> F12 -> Application -> Local Storage -> filter "token" -> click "Toggle device toolbar" -> voila

Threw it in .env as variable TOKEN=... and my index.js is implemented as followings

const Discord = require("discord.js");
const dotenv = require("dotenv");
dotenv.config();

const client = new Discord.Client({
  intents: [
    Discord.Intents.FLAGS.GUILDS,
  ]
});

client.on('ready', ()=> {
  console.log(`Logged in as ${client.user.tag}`);
});

client.login(process.env.TOKEN);

However, when I run node index.js I receive following errors

D:\SourceTree\discord.js\00_get_server_channel_list\node_modules\discord.js\src\client\websocket\WebSocketManager.js:129
    const invalidToken = new Error(WSCodes[4004]);
                         ^

Error [TOKEN_INVALID]: An invalid token was provided.

Is the token found in the video wrong? Or is there something else I am doing wrong?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

If you are making a discord bot The token you get from that video is your user token, not your bots token. To get your bots token go to https://discord.com/developers/applications Go to your Bots Application > Bot Tab on the left > Reset Token > Copy Token

If you dont already have an application press New Application, Name it > Bot tab on the left > Build A Bot > Reset Token > Copy Token

https://www.writebots.com/discord-bot-token/ Read Through this if ur having trouble

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda