Discord.js v12 send the error message from dm

  discord.js, javascript, node.js

I want to sending the error message from dm to users. But I’m getting ReferenceError: error is not defined error. How can I fix this?

if (error) {
   client.users.cache.get(message.author.id).send(error)
}

Source: Ask Javascript Questions

LEAVE A COMMENT