Until now, axisymmetric, α-disc models have been adopted for calculations of the chemical composition of protoplanetary discs. While this approach is reasonable for many discs, it is not appropriate when self-gravity is important. In this case, spiral waves and shocks cause temperature and density variations that affect the chemistry. We have adopted a dynamical model of a solar-mass star surrounded by a massive (0.39 M⊙), self-gravitating disc, similar to those that may be found around Class 0 and early Class I protostars, in a study of disc chemistry. We find that for each of a number of species, e.g. H2O, adsorption and desorption dominate the changes in the gas-phase fractional abundance; because the desorption rates are very sensitive to temperature, maps of the emissions from such species should reveal the locations of shocks of varying strengths. The gas-phase fractional abundances of some other species, e.g. CS, are also affected by gas-phase reactions, particularly in warm shocked regions. We conclude that the dynamics of massive discs have a strong impact on how they appear when imaged in the emission lines of various molecular species.