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.

Context: 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.