Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

189
Vistas
DiscordJS V13 doesnt react to dms

I have this very basic code for a very basic discord bot

since the new discord.js version 13 you need to declare intents.

I tried doing that using the bitmap 32767 (basically declaring all intents), however the bot doesnt trigger the "messageCreate" event when a message is send in the dms it only works in servers.

All privileged gateway intents on the developer site have been set to true.

What am I missing?

const Discord = require("discord.js");
const allIntents = new Discord.Intents(32767);
const client = new Discord.Client({ intents: allIntents });


require("dotenv").config();
const botName = "Miku";

client.once("ready", () => {
    //gets executed once at the start of the bot
    console.log(botName + " is online!");
});


client.on("messageCreate", (message) => {
    console.log("got a message");
});


(async() => {
    //bot connects with Discord api
    client.login(process.env.TOKEN);
})();

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You cannot listen for events in the Direct Messages unless they are direct responses/replies/reactions to the initial message.

For example, you can send a message to new members and wait for a response:

client.on('guildMemberAdd', member =>{
    member.send("Welcome to the server!");

    message.awaitReactions(filter, { max: 1, time: 60000, errors: ['time'] })
    .then((collected) => {
       //Now, write your code here that handles the reactions. 
    });

but there is no way to listen for events within the Direct Messages. As in, client.on... will never fire because of a DM event.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda