38a39,40 > stop = False > 118a121 > self.stop = True 503,506c506,511 < try: < bot.start() < finally: < db.close() --- > while not bot.stop: > try: > bot.start() > except: > print '%s: Exception occured, restarting bot' > db.close()