It turns out $nick eventually becomes the nick of the user issuing the command.