Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

172
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!