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

175
Views
V13 Discord.JS Bot is not sending messages

This's my code below, I have tried enabling Intents from the developer portal, and I've checked the channel permissions, and my node version is running on v16.14.2, and still, it doesn't send any messages for some reason.

const { Client, Intents } = require("discord.js");
const { token } = require("./config.json");

const client = new Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.DIRECT_MESSAGE_REACTIONS, Intents.FLAGS.GUILD_MESSAGES],
});
client.on("ready", () => {
    console.log("Ready");
});

client.on("messageCreate", (message) => {
    if (message === "ping") {
        message.reply({
            content: "pong",
        });
    }
});

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

0

You are comparing an object with a string, the error is in your if() statement:

if(message.content=='ping'){
    message.reply('pong')
}
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!