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 "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)