code: def shutdown(self, msg, args):
          
          self.log.info("Received shutdown from %s", msg.user.username)
          self._bot.runnable = False
          return "Shutting down..."
docs: Causes the bot to gracefully shutdown.