Automated tools for the computation of amplitudes and cross sections have become the backbone of phenomenological studies beyond the standard model. We present the latest developments in MadDM, a calculator of dark-matter observables based on MadGraph5_aMC@NLO. The new version enables the fully automated computation of loop-induced annihilation processes, relevant for indirect detection of dark matter. Of particular interest is the direct annihilation into photons, γγ, γX. These processes lead to monochromatic gamma-ray lines that are smoking-gun signatures for dark-matter annihilation in our Galaxy. MadDM computes the predictions for the expected photon fluxes near Earth and derives constraints from the gamma-ray line searches by Fermi-LAT and HESS. As an application, we present the implications for the parameter space of the Inert Doublet Model.