Index.js
const path = require('node:path');
const { Client, Collection, GatewayIntentBits, Partials } = require('discord.js');
const { token } = require('./config.json'); const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildPresences, GatewayIntentBits.MessageContent, GatewayIntentBits.DirectMessages],
partials: [Partials.Channel]
});```
the console.log works but the bot doesn't reply.
Message handling.
```module.exports = {
name: 'messageCreate',
execute(message) {
console.log(`Received a message from ${message.author.tag}: ${message.content}`);
if (message.author.bot) return;
if (message.channel.type === 'dm' && message.content === '!hi') {
message.author.send('Hello!');
}
},
};```