Navin
Navin
DIAdiscord.js - Imagine an app
Created by Navin on 10/5/2024 in #djs-questions
Bot not receiving DM's
This is my bots code.
console.log(message)
// If the message is from a bot, do nothing
if (message.author.bot) return;
if (message.channel.type !== 1) return;
console.log('Channel type:', message.channel.type, packages.Discord.ChannelType.DM);
console.log(message)
// If the message is from a bot, do nothing
if (message.author.bot) return;
if (message.channel.type !== 1) return;
console.log('Channel type:', message.channel.type, packages.Discord.ChannelType.DM);
It doesnt log anything when the message is in the dms but it does when when its sent in a guild. In my bot.js I have
const Client = new packages.Discord.Client({
intents: configs.ClientIntents()
})
const Client = new packages.Discord.Client({
intents: configs.ClientIntents()
})
With the ClientIntents() being
function ClientIntents() {
const intents = Object.keys(packages.Discord.GatewayIntentBits).map((key) => {
return packages.Discord.GatewayIntentBits[key];
})


console.log(intents)

return intents;
}
function ClientIntents() {
const intents = Object.keys(packages.Discord.GatewayIntentBits).map((key) => {
return packages.Discord.GatewayIntentBits[key];
})


console.log(intents)

return intents;
}
Also no errors come
9 replies