Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

313
Visualizações
Discord.JS V13 client.on messagecreate not firing

I've just recently finished upgrading my Discord.js bot to v13 and now the client.on(messageCreate) function doesn't fire? None of my code in it ever runs and I'm really confused as to why.

Before anybody asks, I have already set my intents.

const client = new Discord.Client({
  intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES ],
  partials: ['MESSAGE', 'CHANNEL', 'REACTION'], 
});

I have two functions, the client.on fires but the message doesn't

client.on('ready', () => {
  console.log(`Logged in as ${client.user.tag}!`);
});

client.on('messageCreate', msg => {
  console.log(anything)
}
about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Make sure you include GUILDS in your list of intents. Otherwise, the bot can only see messages that have been sent after the bot itself sent a message.

In my case, I needed to set these:

partials: ['MESSAGE', 'CHANNEL', 'REACTION']
intents: ['DIRECT_MESSAGES', 'DIRECT_MESSAGE_REACTIONS', 'GUILD_MESSAGES', 'GUILD_MESSAGE_REACTIONS', 'GUILDS']

but the particulars will vary by your use case.

about 4 years ago · Juan Pablo Isaza Relatório

0

You could try replacing your messageCreate with an async option, probs don't fix your issue but you can always try

client.on('messageCreate', async (message) => {
      console.log("DEBUG");
}

See if there are any errors on your console or does it send "DEBUG" message when you sent a message to the channel that the bot can see.

On my own bot, I do not have partials set, so you probably don't need them either.

Make sure you have also included your discord.js properly, here is example:

const { Client, Intents } = require("discord.js");
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda