Fix Discord Close Code 4014 (Disallowed Intents)
Step-by-step fix for Discord close code 4014 in discord.js and discord.py, plus how to remove unused privileged intents.
What Discord close code 4014 means
When your bot connects to Discord's Gateway, it tells Discord which events it wants to receive (called Gateway Intents). Three of those intents are marked privileged because they expose member activity or message text:
- Message Content Intent (
GatewayIntentBits.MessageContent/intents.message_content) — required to read normal chat message text, prefix commands like!help, attachments, and embeds. - Server Members Intent (
GatewayIntentBits.GuildMembers/intents.members) — required for member join/leave events, welcome messages, and fetching full member lists. - Presence Intent (
GatewayIntentBits.GuildPresences/intents.presences) — required only to read live online/idle/game status updates for members.
If your code requests one of these intents while its toggle is switched off in the Discord Developer Portal, Discord closes the connection immediately with close code 4014
:
- discord.js: Error: Used disallowed intents
- discord.py: discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal.
Step 1: Enable the required intent in Discord
- Open the Discord Developer Portal and select your bot's application.
- Open the Bot tab in the left sidebar and scroll down to Privileged Gateway Intents.
- Turn on only the toggle(s) your bot genuinely uses — most commonly Message Content Intent and/or Server Members Intent.
- Click Save Changes at the bottom of the page, then restart your bot.
Step 2: Remove intents your bot doesn't actually need
A very common mistake — especially in starter templates and AI-generated code — is requesting Intents.all()
or enabling Presence Intent when the bot only uses slash commands. Removing unused privileged intents fixes 4014
, cuts memory usage, and avoids heavy presence event traffic.
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
// Add GuildMessages + MessageContent only if you read regular chat text:
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
});
import discord
from discord.ext import commands
intents = discord.Intents.default()
# Turn on only what you use (avoid discord.Intents.all() unless needed):
intents.message_content = True
# intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
/slash
commands, buttons, and modals, you usually only need GatewayIntentBits.Guilds
(or discord.Intents.default()
) — zero privileged intents required.
How Blip Host catches 4014 automatically
On Blip Host, you do not have to wait for a crash loop to notice a missing intent. When you paste your token during bot setup, Blip Host checks your Developer Portal flags right away. If a running bot later hits 4014
, Blip Host flags the exact missing toggle on your bot overview with a direct link to the Developer Portal and sends you an email alert.
After saving the toggle in Discord, click Re-check with Discord on the banner and your bot reconnects automatically.