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

157
Visualizações
Unhandled promise rejection: DiscordAPIError: Cannot send messages to this user
let embed = new Discord.MessageEmbed()
    .addField("DJ", `https://discord.gg/microsoft`)
    .addField("Unchecked`)
    .setColor("#363940")
    .setTimestamp();
        
msg.author.send(embed);     

let xd = new Discord.MessageEmbed()
    .setColor("#ff0000")
    .setTitle("CHECK YOUR DM")
    .setThumbnail("https://cdn.discordapp.com/attachments/773133136929226763/797204521997828106/777514274829893683.gif")
    .setFooter("DJ")
    .setTimestamp()
    .setDescription("I've sent you")

msg.reply(xd).then(m => {
    setTimeout(() => {
        m.delete();
    }, 900000);
});

cooldown.add(msg.author.id);
setTimeout(() => {
    cooldown.delete(msg.author.id);
}, config.COOLDOWN * 60 * 1000);
about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

about "cannot send message to this user":

It could happen due to some reasons;

• The user doesn't share a server with the bot,

• The user has dms closed,

• The user has the bot blocked.

So you'll need to handle the error by putting .catch(console.error) or .catch((e) => {//Function here})

To fix it, replace the msg.author.send(embed) with the following:

msg.author.send(embed).catch(console.error)     


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