code: def leave(self):
          
          try:
              self.client.api.leave_room(self.room_id)
              del self.client.rooms[self.room_id]
              return True
          except MatrixRequestError:
              return False
docs: Leave the room.
  
          Returns:
              boolean: Leaving the room was successful.