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

309
Vistas
Discord.js bot getting a Bitfield Invalid error after changing intent

Had another post about my bot running in the terminal, but not posting a message in the discord channel. I changed the intents because I cam across a different question where someone needed to change the intents so that the bot would post in Discord.. After I made the change to intents I am now getting this error: RangeError [BITFIELD_INVALID]: Invalid bitfield flag or number: undefined.

require('dotenv').config();
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILD_MESSAGES, Intents.message, Intents.channel, Intents.reaction] });


client.on('ready', () => {
  console.log(`It's welcome time`);
});

client.on('message', msg => {
  if (msg.content === 'Hi') {
    msg.reply('Welcome wallet warrior!');
    msg.channel.send('Welcome wallet warrior!');

  }
  else {
    msg.channel.send('Hi, please introduce yourself')
  };

});

client.login(TOKEN);
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

It's because Intents.message Intents.channel Intents.reaction is undefined, or has no value.

The right Intents you probably need:

const { Client, Intents } = require('discord.js');
const client = new Client({
     intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MESSAGES,
        Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
     ]
});

There is a discord.js official guide that might help you. Intents Calculator

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