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

111
Views
Bot does not receive messages

I'm trying to make my bot reply on messages but it doesn't work. Does anybody know how to fix this?

Code:

const Discord = require('discord.js');

const client = new Discord.Client({ intents: ['GuildMessages', 'GuildMessageReactions', 'GuildMessageTyping', 'MessageContent', ''] })

const prefix = '!';

client.once('ready', () => {
    console.log('MONKE BOT RISES');
});

client.on('messageCreate', message => {
    message.channel.send('pong');
    console.log('hoi');
    if(!message.content.startsWith(prefix) || message.author.bot) return;

    const args = message.content.slice(prefix.length).split(/ +/);
    const command = args.shift().toLowerCase();

    if(command === 'ping'){
        message.channel.send('pong');
    }
});



client.login('<token>');
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You'll need to enable the MessageContent gateway intent in the Discord Developer Portal due to its priviledged nature.

enter image description here

Check out a good article on this in the docs.

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!