The single-particle spectral function of a strongly correlated system is an essential ingredient to describe its dynamics and transport properties. We develop a general method to calculate the exact spectral function of a strongly interacting one-dimensional Bose gas in the Tonks-Girardeau regime, valid for any type of confining potential, and apply it to bosons on a lattice to obtain the full spectral function, at all energy and momentum scales. We find that it displays three main singularity lines. The first two can be identified as the analogs of Lieb-I and Lieb-II modes of a uniform fluid; the third one, instead, is specifically due to the presence of the lattice. We show that the spectral function displays a power-law behaviour close to the Lieb-I and Lieb-II singularities, as predicted by the non-linear Luttinger liquid description, and obtain the exact exponents. In particular, the Lieb-II mode shows a divergence in the spectral function, differently from what happens in the dynamical structure factor, thus providing a route to probe it in experiments with ultracold atoms.