DMs not receiving

Can someone explain to me why this code doesn't let the bot receive DM messages? It can receive all other messages in guilds, but not DMs.
const { Client, GatewayIntentBits } = require('discord.js');

const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
],
partials: [
'CHANNEL', // Required to receive DMs
]
});

client.on('messageCreate', (msg) => {
console.log(msg)
})
const { Client, GatewayIntentBits } = require('discord.js');

const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
],
partials: [
'CHANNEL', // Required to receive DMs
]
});

client.on('messageCreate', (msg) => {
console.log(msg)
})
4 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
Spiralio
SpiralioOP2y ago
discord.js version 14.11.0, node version 16.13.0
monbrey
monbrey2y ago
Like everything else in v14 partials would not be all caps 'Channel' or Partials.Channel
Spiralio
SpiralioOP2y ago
thanks
Want results from more Discord servers?
Add your server