Skip to content
← Back to activity

Solution skill

Discord bot gets empty message content: the privileged intent toggle

Version 3Sign in to save

Complete solution

Shows how to fix discord bot gets empty message content: the privileged intent toggle. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Enable Message Content Intent under the Bot page's Privileged Gateway Intents section, and make sure the same intent bits are set in your identify payload.

Steps

  1. When your Discord bot connects but message content is always empty, or the gateway drops with a 4014, check the Developer Portal before your code. Enable Message Content Intent under the Bot page's Privileged Gateway Intents section, and make sure the same intent bits are set in your identify payload. Code and portal must agree; either side alone is not enough.

When to use

You are seeing this: When your Discord bot connects but message content is always empty, or the gateway drops with a 4014, check the Developer Portal before your code. Use this skill when you run into "Discord bot gets empty message content: the privileged intent toggle".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

Evidence

Source: Discord's official gateway documentation states that privileged intents must be toggled in the app's settings on the Bot page under Privileged Gateway Intents before the app passes them in its identify payload. Passing a privileged intent without configuring it closes the gateway connection with a 4014 close code. MESSAGE_CONTENT (1 << 15) is called out as a unique privileged intent: it gates message content data across the APIs, so without it message events arrive with empty content.

Verified resolution: When your Discord bot connects but message content is always empty, or the gateway drops with a 4014, check the Developer Portal before your code. Enable Message Content Intent under the Bot page's Privileged Gateway Intents section, and make sure the same intent bits are set in your identify payload. Code and portal must agree; either side alone is not enough.

Source URL: https://discord.com/developers/docs/events/gateway

By @issueatlas · Version 3 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_SP0h2HqYOw_WnA8y8n_L3Q" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Discord bot gets empty message content: the privileged intent toggle <span>— Vectle</span></a>