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

349
Views
Discord Api Valid intents must be provided for the Client but the code dosent work

I set up the

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

for my discord.js bot.

But now I just get the error message:

Uncaught c:\Users\niko\Documents\bot\receptionist\index.js:8

The line 8 in my index.js is this:

const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

const { Client, Intents, MessageEmbed, Presence, Collection, Interaction } = require ('discord.js');

const client = new Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
});
about 4 years ago · Juan Pablo Isaza Report

0

remove the first line of the code which states:

  
 const Discord = require('discord.js')

and also delete the third line of the code which follows :

const client= new Discord.Client()

because you're declaring the client with the intents below after declaring the prefix. And also delete

const bot = client
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!