Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

177
Visualizações
I'm trying to make a discord bot receive this error [Symbol(code)]: 'BITFIELD_INVALID'

Following is the code snippet I am trying:

const Discord = require("discord.js");
const client = new Discord.Client({intents:["GUILD_VOICE_STATES","VOICE_STATE_UPDATE"]});
const config = require("./config.json");

client.login(config.token);
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

From the guide

To enable your intents,

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

You will also have to require the Intents class,

const { Discord, Intents } = require("discord.js");

Most importantly however, "VOICE_STATE_UPDATE" is not an intent, its an event that can only be received with the GUILD_VOICE_STATE intent

about 4 years ago · Juan Pablo Isaza Relatório

0

VOICE_STATE_UPDATE is not a valid intent. The GUILD_VOICE_STATES is what you want (you have this but VOICE_STATE_UPDATE is invalid). These are the intents you should have to track voice states:

  • GuildMember intents
  • Voice states

Therefore this is how you should declare client

const client = new Discord.Client({
  intents: [
    "GUILD_VOICE_STATES",
    "GUILDS",
    "GUILD_MEMBERS"
  ]
})
//GUILDS is required for some other intents like messages and members
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda