Here is the actual announcement of the redshift from Andrew Levan. For those unfamiliar with astronomy practices, circulars are generally where simple things like discoveries, first spectra, redshifts, etc. are announced just as soon as the data is gathered and a preliminary reduction is performed, usually issued the morning after the observation.
In this case, the Gemini Multi Object Spectrograph (GMOS), attached to the $8\ \mathrm{m}$-class Gemini-North telescope, was used to get a visible/near-UV spectrum of the afterglow the same day the burst was detected. Absorption lines for calcium1 and magnesium2 were used to get a redshift of $0.34$.
So yes, it is optical astronomy pinning down the redshift. As to how this was done so fast, GRB's (and other interesting transients) are followed by many observatories, which have measures in place to slew to "targets of opportunity" the moment they are reported to get data before they vanish. For GRB's in particular, they are often detected in gamma rays first, but gamma ray "telescopes" are basically blocks of scintillating material sitting in space, and so they have terrible angular resolution. Here, as is often the case, the Swift satellite was triggered to search the general area with its X-ray instrument, getting a somewhat more precise sky position. Then other facilities operating in other EM bands were able to look for the object. This happens largely automatically over the course of minutes to hours.
1 Specifically, the H and K lines were used. These are very common for getting redshifts of galaxies hosting distant transient phenomena.
2 $\mathrm{Mg}~\mathrm{I}$ is atomic; $\mathrm{Mg}~\mathrm{II}$ is singly-ionized. The latter has a nice, recognizable doublet at rest wavelengths of 2796.352 Å and 2803.530 Å, as described in this Astrobites article. By the way, you will often see the doublet referred to with the numbers 2796/2803 rather than 2796/2804, which is not an effect of truncation instead of proper rounding, but rather a leftover tradition from back when spectroscopy was reported in air wavelengths rather than vacuum ones.