merged from https://github.com/BlitzKraft/bitbot/blob/master/modules/xkcd.py also adds debug logging to ttm.py