Why does my Discord bot get Missing Permissions (50013)?

Error 50013 means the bot could see what it was aiming at and Discord refused the action anyway. There are six causes: the bot's role lacks the permission, a channel overwrite takes it away, a permission change names something the bot does not hold in that channel, the target is the server owner (or, for a timeout, an administrator), the role belongs to an integration, or the target sits at or above the bot's highest role. Check them in that order, because moving the bot's role up fixes only the last one.

Updated · the Bond team

Fix it in the Discord app

Work down the list and stop at the first step that finds something.

  1. Give the bot's role the permission. Open Server Settings → Roles and pick the bot's role, which usually carries the bot's name. On the Permissions tab, turn on what the action needs: Manage Channels to create or edit channels, Manage Roles to create, edit or hand out roles, Manage Server for server settings, Manage Messages to delete other people's messages, Manage Nicknames to rename members, and Timeout Members or Ban Members for moderation. Press Save Changes.
  2. Read the channel's overwrites. Right-click the channel → Edit Channel → Permissions → Advanced permissions. Check @everyone first, then every role the bot has. A red X on View Channel, or on the permission the action needs, stops the bot in this channel even when its role has that permission server-wide. Press the plus button, add the bot's role, and set that permission to the green check. If the channel is synced to its category, make the change on the category so every synced channel gets it.
  3. If the bot was changing a channel's permissions, give its role a green check in that channel on every permission it was trying to allow or deny. A green check on Manage Permissions there also works.
  4. If the target is a role or a member, compare positions in Server Settings → Roles. The bot's highest role has to sit above the role it hands out, and above the highest role of the member it moderates or renames. Drag the bot's role up past it.
  5. Try the action again.

The rule

Discord lists 50013 as "You lack permissions to perform that action" in its JSON error codes. Unlike Missing Access (50001), the request got to the channel, role or member and was turned down. Discord decides what a bot may do in layers, and the refusal can come from any of them.

Server permissions. A bot holds everything its roles allow in Server Settings → Roles, added together. Administrator "allows all permissions and bypasses channel permission overwrites", in the words of Discord's permissions documentation, so a bot that has it never gets stopped by the next layer.

Channel overwrites. Each channel, and the category it syncs to, can allow or deny any permission for a role or for one member. A red X on the bot's role, or on @everyone when none of the bot's roles has a green check, beats the server-wide grant in that channel.

Permission changes. When a bot edits a channel's permissions, Discord's channel documentation says it can only allow or deny permissions it holds itself in the server or the parent channel, unless the channel's own permissions give the bot's role a green check on Manage Permissions. When a bot creates a channel with permissions already set, it can only allow or deny what it holds server-wide, and only an administrator can put Manage Permissions on a channel that way (creating a channel). Role position plays no part in either.

Role hierarchy. The same permissions documentation says "A bot can grant roles to other users that are of a lower position than its own highest role", and that a bot "can only kick, ban, and edit nicknames for users whose highest role is lower than the bot's highest role." Administrator does not lift this. Discord's Roles and Permissions guide says the same about people: members cannot ban, kick or rename anyone with an equal or higher role.

The owner and integration roles. Nobody can kick, ban or time out the server owner, and only the owner can change their own nickname. A timeout also fails on any member who has Administrator, as Discord's member documentation notes. Roles that belong to an integration, such as a bot's own role or Server Booster, cannot be given to members or deleted by anyone.

If this, then that

  • If it fails in one channel and works everywhere else, it is an overwrite on that channel or its category. The role settings in Server Settings are not the problem.
  • If it fails when the bot creates a channel, check that its role has Manage Channels and that the category it creates into has no red X for the bot on Manage Channels. If the new channel is meant to be private, the bot can only set permissions it holds itself, and only an administrator can put Manage Permissions on the new channel.
  • If it fails when the bot hands out a role, the role is at or above the bot's highest role, or it belongs to an integration. Why a bot cannot assign a role covers both.
  • If it fails when the bot times someone out, check whether they have Administrator. Discord refuses a timeout on an administrator or the owner, whatever the bot holds.
  • If the bot has Administrator and still gets 50013, it is almost always role position, the owner, an integration role or the timeout rule. No channel setting can cause it.
  • If the error says Missing Access (50001) instead, the bot cannot see the target at all. See Missing Access (50001).

What Bond does here

Most answers to 50013 say to move the bot's role to the top. For a channel permission change that advice is wrong, because Discord does not use role hierarchy there. When Discord refuses Bond, Bond works out which of the six causes it hit from the facts you would check by hand: its own highest role and position, what it holds in that channel, and what the target is. It names the cause and the one fix, and asks you to tell it when the fix is in rather than trying the same thing again. It will not hand itself the access it lacks either: a change to its own role's channel permissions that would give it View Channel or a Manage permission it does not already hold there is refused by Bond before Discord sees it.

bot-commands
Y
youToday at 4:31 PM

@Bond let the Mods role mention everyone in #announcements

BondAPPToday at 4:31 PM

I couldn't set that. Discord only lets me allow or deny permissions I hold myself in #announcements, and my role Bond doesn't have Mention Everyone there.

Moving my role higher won't help: Discord doesn't use role hierarchy for channel permissions.

To fix it, give the Bond role Mention Everyone in Server Settings → Roles, or on #announcements itself. Tell me when that's done and I'll set it for Mods.

Message #bot-commands

An example with made-up names, not a captured run. The cause and the fix follow the check Bond runs when Discord refuses it; a live reply puts them in its own words.

Questions people ask

  • Why does my bot get Missing Permissions when creating a channel?

    Its role lacks Manage Channels, or the category it creates into gives the bot's role a red X on Manage Channels. If the new channel is created with its own permissions, the bot can only allow or deny what it holds across the server, and only an administrator can put Manage Permissions on it. Role position has nothing to do with it.

  • Why does my bot get Missing Permissions when it has Administrator?

    Administrator takes channel overwrites out of the picture, not role position. A bot with Administrator still cannot manage a role at or above its own highest role, act on a member whose highest role is at or above its own, act on the server owner, hand out an integration's role, or time out another administrator.

  • Should I just give the bot Administrator?

    It hides the problem rather than fixing it, and it lets the bot into every private channel you have. Give its role the specific permission instead, and put the role above the roles it has to manage and below your staff roles.

  • Why does moving the bot's role to the top not fix it?

    Role position only matters when the target is a role or a member. If the bot was changing a channel's permissions, or an overwrite on the channel denies it, the fix is in that channel's Permissions tab, not in the role list.

  • Can the bot give itself the permission it is missing?

    No. Discord lets a bot edit only roles below its own highest role, and only with permissions it already holds, so it cannot add a permission it lacks to any of its roles. Someone who holds that permission has to add it in Server Settings → Roles or on the channel. Bond does not try: it names the permission and the role to add it to.

Bond runs these checks for you: it names the setting that blocked it and the fix, and it never widens a permission to get its own way.