const { Client, GatewayIntentBits, Partials } = require('discord.js')
const {token} = require("../config.json")
const client = new Client({
'intents': [
GatewayIntentBits.DirectMessages,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildMessages,
],
'partials': [Partials.Channel]
});
client.on('messageCreate', (message) => {
console.log(message.content)
});
client.login(token)
Bot Permissions
Problem
I've been researching the issue for 1-2 weeks but couldn't find a solution. My problem is that message.content is empty. There were several places on the Discord developer portal suggesting that I allow it, but I still always get a blank result.
I want to receive any message that users send to channels so I am using this code.