My bot don't receive direct message

const { config } = require('dotenv');
config();

const { Client, GatewayIntentBits, ComponentType, ButtonStyle, Events } = require('discord.js');

const client = new Client({ intents: [GatewayIntentBits.DirectMessages] });

client.on(Events.ClientReady, () => {
    console.log('[INFO] Bot is ready!');
});

client.on(Events.MessageCreate, async message => {
    if (message.inGuild()) {
        return;
    }

    console.log("Hello World");
});

client.login(process.env.MODMAIL_TOKEN);


There is no log... I don't understand what I am missing...
Was this page helpful?