zulip-bot.py: refactor