code: func addTimeContext(db *sqlx.DB, in *dt.Msg) error {
  	var addContext bool
  	for _, stem := range in.Stems {
  		if stem == "then" {
  			addContext = true
  			break
  		}
  	}
  	if !addContext {
  		return nil
  	}
  	var byt []byte
  	var err error
  	if in.User.ID > 0 {
  		q := `SELECT value FROM states WHERE userid=$1 AND key=$2`
  		err = db.Get(&byt, q, in.User.ID, keyContextTime)
  	} else {
  		q := `SELECT value FROM states
  		      WHERE flexid=$1 AND flexidtype=$2 AND key=$3`
  		err = db.Get(&byt, q, in.User.FlexID, in.User.FlexIDType,
  			keyContextTime)
  	}
  	if err == sql.ErrNoRows {
  		return nil
  	}
  	if err != nil {
  		return err
  	}
  	var times []time.Time
  	if err = json.Unmarshal(byt, &times); err != nil {
  		return err
  	}
  	in.StructuredInput.Times = times
  	return nil
  }
docs: // addTimeContext adds a time context to a Message if the word "then" is found.