I'm having an issue when trying to grant roles to server admins. For regular permissions it works fine, but if it's a server admin role, or some other role with permissions, even if I'm the owner, it gives the following error:
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions
And the code I'm using is:
@client.command()
@commands.has_permissions(manage_messages = True)
async def grant(ctx , user : discord.Member , role : discord.Role):
await user.add_roles(role)
await ctx.send(f"Our Comrade {user.name} has received the {role.name} role!")
Any help would be appreciated!
403 Forbidden (error code: 50013): Missing Permissions
shows up not because you don't have permissions but rather because the bot doesn't have permissions. Try moving the bot's top role up the role hierarchy and give it all the required permissions. In this case, it needs to be above the admin role and have the Manage Roles
permission.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With