Yep, that is helpful. In line 54, you are receiving messages. One of those will be a PING. . You want to call your sendChatMessage("PONG :tmi.twitch.tv") whenever that happens.
The simple case to do that would be to put it in an if statement, "if message == “PING :tmi.twitch.tv”