I wrote a little Python Script which should give the "Administrator" permission to a certain role, just to try how role editing works. This is my code:
@bot.command()
async def EditRoleTest(ctx):
await ctx.guild.roles[1].edit("permissions(administrator)")
But as soon as I try to run it, the following error occurs:
discord.ext.commands.errors.CommandInvokeError:
Command raised an exception:
TypeError: edit() takes 1 positional argument but 2 were given
So how do I pass the argument that I want to add the permission administrator? Thanks in advance.
When editing a role you must pass a discord.Permissions
instance as a keyword-only argument
role = ctx.guild.roles[1] # Or another role object
perms = discord.Permissions(administrator=True)
await role.edit(permissions=perms)