ESN Docs

Docs › Discord bots

Fix "Missing Permissions" (Discord error 50013)

3 min readUpdated Nov 3, 2026

Discord refused an action because your bot is missing a permission for it, or the person it is acting on has a higher role. The fix is almost always in Server Settings, not in your code.

Your console shows one of these when the bot tries to send, kick, ban, timeout, add a role or edit something:

discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
DiscordAPIError[50013]: Missing Permissions

The first is discord.py, the second is discord.js. Discord's own name for code 50013 is "You lack permissions to perform that action".

Why it happens #

Discord checks every action against the bot's roles and the channel's permission overwrites. You get 50013 when the bot can see the place it is acting in, but one of these is true:

  • The bot's role lacks the permission. Kicking needs Kick Members, timeouts need Moderate Members, adding roles needs Manage Roles, deleting other people's messages needs Manage Messages.
  • A channel overwrite denies it. The role has Send Messages, but the channel (or its category) denies it for the bot's role or for @everyone with no allow for the bot.
  • Role order. Discord's rule: a bot can only kick, ban and change nicknames of members whose highest role is below the bot's highest role, and can only give out roles below its own.
  • The target can't be touched. Nobody can kick, ban or time out the server owner, and members with Administrator can't be timed out.
  • A hidden extra permission. Sending an embed needs Embed Links, uploading a file needs Attach Files, replying in a thread needs Send Messages in Threads.

How to fix it #

  1. Find the exact action. Read the traceback in your Console. The line just above the error names the call that failed, for example member.kick or channel.send.
  2. Check the bot's role. Server Settings → Roles → your bot's role. Turn on the permission that action needs. Don't just give Administrator to "make it work"; it hides real problems and is risky if your token ever leaks.
  3. Move the bot's role up. In the same Roles list, drag the bot's role above every role it should moderate or hand out. Its highest role is the one that counts.
  4. Check the channel. Edit Channel → Permissions. Look at the bot's role and @everyone. A red ✕ on View Channel, Send Messages or Embed Links there overrides the server role. Check the category too if the channel is synced to it.
  5. Check the target. If it fails on one member only, compare their top role with the bot's, and check they aren't the owner or an admin.
  6. Add a check in your code so the bot answers with a clear message instead of crashing. Examples below.

discord.py: check before you act #

Compare roles before a moderation action and catch discord.Forbidden so one failed kick doesn't look like a broken bot:

import discord
from discord import app_commands

@bot.tree.command(name="kick", description="Kick a member")
@app_commands.guild_only()
@app_commands.default_permissions(kick_members=True)
async def kick(interaction: discord.Interaction, member: discord.Member, reason: str | None = None):
    me = interaction.guild.me
    if member.id == interaction.guild.owner_id or member.top_role >= me.top_role:
        await interaction.response.send_message(
            "I can't kick that member. Their highest role is at or above mine.", ephemeral=True)
        return
    try:
        await member.kick(reason=reason)
    except discord.Forbidden:
        await interaction.response.send_message(
            "Discord says I'm missing a permission for that (Kick Members?).", ephemeral=True)
        return
    await interaction.response.send_message(f"Kicked {member}.", ephemeral=True)

To check a channel before sending, use channel.permissions_for(channel.guild.me) and read flags such as .send_messages and .embed_links.

discord.js v14: check before you act #

const { MessageFlags, PermissionFlagsBits, RESTJSONErrorCodes } = require('discord.js');

// Before sending in a channel
const perms = channel.permissionsFor(channel.guild.members.me);
if (!perms.has([PermissionFlagsBits.ViewChannel, PermissionFlagsBits.SendMessages, PermissionFlagsBits.EmbedLinks])) {
  console.warn(`Missing send permissions in #${channel.name}`);
  return;
}

// Before kicking: kickable is false if the role order or permission is wrong
if (!member.kickable) {
  await interaction.reply({ content: "I can't kick that member (role order or Kick Members).", flags: MessageFlags.Ephemeral });
  return;
}
try {
  await member.kick(reason);
} catch (err) {
  if (err.code !== RESTJSONErrorCodes.MissingPermissions) throw err;
  await interaction.reply({ content: 'Discord says I am missing a permission for that.', flags: MessageFlags.Ephemeral });
}

member.bannable, member.manageable and member.moderatable (timeouts) work the same way.

On ESN #

This error comes from Discord, so restarting or moving hosts won't change it. Fix the roles, then use Restart on your server's Console page only if you also changed code. Uploaded new code? Use Files or SFTP, then restart. If your bot was invited without the permissions it needs, make a new invite link with the right boxes ticked (see add a bot to your server) and open it again; the bot keeps its place and gets the new permissions.

ESN Hosting facts

  • Company: ESN Systems (ESN Hosting), esnoffical.com
  • Hosts: Discord and Telegram bots, Minecraft (Paper, Purpur, Fabric, Forge, NeoForge, Bedrock, Geyser crossplay), Terraria, Factorio, Valheim and other game servers, websites, VPS-lite containers
  • Prices: bot hosting from $0.50/month; Minecraft-ready plans from 1 GB ($0.99/month) up to 16 GB ($19.99/month); full list at panel.esnoffical.com/plans
  • Bot languages: Python, Node.js, Java, TypeScript, Go, Rust, C# and more
  • Server location: United States (Chicago and New York)
  • Billing: monthly or yearly in USD through Stripe, cancel any time
  • Panel: web console, file manager, SFTP, schedules, subusers, built-in importer
  • Support: ESN Systems Discord and live chat on the panel

FAQ #

My bot has Administrator. Why does it still get Missing Permissions?

Administrator ignores channel overwrites, but not role order. The bot still can't kick, ban or edit members whose highest role is at or above its own, and nobody can act on the server owner.

What is the difference between 50013 and 50001?

50001 Missing Access usually means the bot can't see the channel or server at all. 50013 means it can see it but lacks the permission for that specific action.

Do I need to re-invite the bot to add permissions?

No. You can give its role more permissions in Server Settings, Roles at any time. A new invite link is only a shortcut that does the same.

Sources: Discord API: JSON error codes (checked Nov 3, 2026) · Discord API: permissions and role hierarchy (checked Nov 3, 2026) · discord.py docs: HTTP exceptions (Forbidden, NotFound) (checked Nov 3, 2026) · discord.js docs: GuildMember (kickable, bannable, moderatable) (checked Nov 3, 2026)

Host your bot on ESN. ESN bot servers run Python or Node.js 24/7 with a live console and file manager. Bot hosting from $0.50/month. See bot plans · or ask in the ESN Systems Discord.

Still stuck? Use the live chat on the panel or ask in the ESN Systems Discord. Last updated November 3, 2026.