Copied main bot code from Allison Kaptur's bot.