code: async def edit(self, *, reason=None, **fields):
          
  
          position = fields.get('position')
          if position is not None:
              await self._move(position, reason=reason)
              self.position = position
  
          try:
              colour = fields['colour']
          except KeyError:
              colour = fields.get('color', self.colour)
  
          payload = {
              'name': fields.get('name', self.name),
              'permissions': fields.get('permissions', self.permissions).value,
              'color': colour.value,
              'hoist': fields.get('hoist', self.hoist),
              'mentionable': fields.get('mentionable', self.mentionable)
          }
  
          data = await self._state.http.edit_role(self.guild.id, self.id, reason=reason, **payload)
          self._update(data)
docs: |coro|
  
          Edits the role.
  
          You must have the :attr:`~Permissions.manage_roles` permission to
          use this.
  
          All fields are optional.
  
          Parameters
          -----------
          name: :class:`str`
              The new role name to change to.
          permissions: :class:`Permissions`
              The new permissions to change to.
          colour: :class:`Colour`
              The new colour to change to. (aliased to color as well)
          hoist: :class:`bool`
              Indicates if the role should be shown separately in the member list.
          mentionable: :class:`bool`
              Indicates if the role should be mentionable by others.
          position: :class:`int`
              The new role's position. This must be below your top role's
              position or it will fail.
          reason: Optional[:class:`str`]
              The reason for editing this role. Shows up on the audit log.
  
          Raises
          -------
          Forbidden
              You do not have permissions to change the role.
          HTTPException
              Editing the role failed.
          InvalidArgument
              An invalid position was given or the default
              role was asked to be moved.