code: func hapiSettingsUpdate(w http.ResponseWriter, r *http.Request) {
  	if os.Getenv("ABOT_ENV") != "test" {
  		if !isAdmin(w, r) {
  			return
  		}
  		if !isLoggedIn(w, r) {
  			return
  		}
  	}
  	var req map[string]map[string]string
  	if err := json.NewDecoder(r.Body).Decode(&req); err != nil {
  		writeErrorBadRequest(w, err)
  		return
  	}
  	tx, err := db.Begin()
  	if err != nil {
  		writeErrorInternal(w, err)
  		return
  	}
  	for plugin, data := range req {
  		for k, v := range data {
  			q := `INSERT INTO settings (name, value, pluginname)
  			      VALUES ($1, $2, $3)
  			      ON CONFLICT (name, pluginname) DO
  				UPDATE SET value=$2`
  			_, err = tx.Exec(q, k, v, plugin)
  			if err != nil {
  				writeErrorInternal(w, err)
  				return
  			}
  		}
  	}
  	if err = tx.Commit(); err != nil {
  		writeErrorInternal(w, err)
  		return
  	}
  	w.WriteHeader(http.StatusOK)
  }
docs: // hapiSettingsUpdate updates settings in the database for plugins.