Receive DM from user to Bot

This is how i check for DM:
// Receive DM from users
if(msg.channel.type === d.ChannelType.DM) {
console.log("We received a DM")
}
// Receive DM from users
if(msg.channel.type === d.ChannelType.DM) {
console.log("We received a DM")
}
This is my intents:
const client = new d.Client({intents: [
d.GatewayIntentBits.Guilds,
d.GatewayIntentBits.DirectMessages,
d.GatewayIntentBits.GuildMessages,
d.GatewayIntentBits.MessageContent,
], partials: ['CHANNEL', 'MESSAGE', 'REACTION']})
const client = new d.Client({intents: [
d.GatewayIntentBits.Guilds,
d.GatewayIntentBits.DirectMessages,
d.GatewayIntentBits.GuildMessages,
d.GatewayIntentBits.MessageContent,
], partials: ['CHANNEL', 'MESSAGE', 'REACTION']})
Yet it dosn't respond to it? the if statement is inside "MessageCreate" i tried to search for answers here but all i found is peolpe missing intents witch i am not? (using latest version)
3 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
d.js docs
d.js docs2y ago
Suggestion for @ulrik3181:guide Popular Topics: Partial Structures read more
U
UOP2y ago
Yup thanks for the help, apprently it was the partials that was wrong. my appologies i had written it wrong
Want results from more Discord servers?
Add your server