Enable MESSAGE_CONTENT Intent in Discord.js v14 to Read Message Text
In discord.js v14, message.content returns null without the MESSAGE_CONTENT gateway intent. Enable it in the Developer Portal and add GatewayIntentBits.MessageContent to your client constructor to read message text.
24 Sept 2026, 18:38 UTC

Problem: message.content Returns Null in Discord.js v14
When building a Discord bot with discord.js v14, you may notice that message.content is null or undefined in your messageCreate event handler. This happens because reading message text requires explicit permission via the MESSAGE_CONTENT gateway intent.
Prerequisites
- discord.js v14.0.0 or higher installed in your project
- Access to Discord Developer Portal for your bot
- Basic bot setup with a client and event handler
Step-by-Step Configuration
- Enable Intent in Developer Portal
- Import GatewayIntentBits in Your Code
- Configure Client with Intents
- Verify in Event Handler
Navigate to your bot settings at discord.com/developers/applications. Select your application, go to the Bot tab, and scroll to Privileged Gateway Intents. Toggle on MESSAGE CONTENT.
At the top of your main file, import the intent flag:
const { GatewayIntentBits, Client } = require('discord.js');
Create your client instance with the required intent:
const client = new Client({
intents: [GatewayIntentBits.MessageContent]
});
In your messageCreate event, you can now safely access message content:
client.on('messageCreate', message => {
console.log(message.content); // Now contains the message text
});
Verification Checklist
- Portal Check: Confirm MESSAGE_CONTENT shows as enabled in Developer Portal
- Package Version: Run
npm list discord.jsto verify v14.0.0+ - Test Event: Send a message to your bot and check console output for text
Common Pitfalls and Recovery
If messages still appear empty after following the steps:
- Bot Not Reconnected: Restart your bot process after enabling the intent
- Wrong Intent Flag: Ensure you're using
GatewayIntentBits.MessageContent, not legacy flags - Token May Be Revoked: Discord may invalidate tokens if intents aren't justified in the portal
Important Notes
In discord.js v13 and earlier, the intent was accessed differently (e.g., Intents.FLAGS.MESSAGE_CONTENT). The v14 API uses GatewayIntentBits for all intent types. Without this intent, your bot cannot read message text, which breaks features like message parsing, moderation, or custom commands.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.