discord.py create role with permissions code example

Example 1: add role discord .py

member = message.author
var = discord.utils.get(message.guild.roles, name = "role name")
member.add_role(var)

Example 2: how to change role permissions in discord.py

#edit permissions of role
permissions = discord.Permissions()
permissions.update(kick_members = False)
await role.edit(reason = None, colour = discord.Colour.blue(), permissions=permissions)

Example 3: how to give a role permissions discord py

server = ctx.message.server
perms = discord.Permissions(send_messages=False, read_messages=True)
await client.create_role(server, name='NoSend', permissions=perms)