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.
- 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.
- 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.
- 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.
- 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.
- 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).