From a discrete model of chemotaxis with volume-filling to a generalized Patlak–Keller–Segel model