I start creating a Discord bot with the Python API of Discord. So, I tried to make a command that give roles on a discord server. Here is my code :
client = commands.Bot(command_prefix = '/')
@client.command()
async def addrole(ctx, role: discord.Role, user: discord.Member):
if ctx.author.guild_permissions.administrator:
await user.add_roles(role)
await ctx.send(f"Successfully given {role.mention} to {user.mention}.")
When I try to use the command, any error happear. I try to make like the websearch I've done but still don't work. Can someone help me ?