tweaked code from https://github.com/barentsen/zoonibot-response