Update bot.js

Updated APIs. Fixed some things.