bot.finish() does what it should when running as a python module