Discord.js v13, если DM

const client = new discord.Client({ partials: ["CHANNEL"], intents: [
    discord.Intents.FLAGS.DIRECT_MESSAGES, 
    discord.Intents.FLAGS.DIRECT_MESSAGE_TYPING
]})
// add: partials: ["CHANNEL"]

client.on('messageCreate', message => {
   if (message.channel.type == 'DM') {
      console.log('Dm recieved!')
   }
})
Pudochu