Read user's properties back from program-y's convo file

Viewed 33

I am trying to save and read the user's properties from file. Currently, I can save his properties to the plain text file. I had tried read the official document, but I couldn't find the answer since it is being developed

config.yml

brain:

    # Overrides
    overrides:
      allow_system_aiml: true
      allow_learn_aiml: true
      allow_learnf_aiml: true

    # Defaults
    defaults:
      default-get: unknown
      default-property: unknown
      default-map: unknown
      learnf-path: $BOT_ROOT/aimlf

    # Nodes
    nodes:
      pattern_nodes: $BOT_ROOT/config/pattern_nodes.conf
      template_nodes: $BOT_ROOT/config/template_nodes.conf

    # Binary
    binaries:
      save_binary: false
      load_binary: false
      binary_filename: /tmp/y-bot.brain
      load_aiml_on_binary_fail: false

    # Braintree
    braintree:
      file: /tmp/braintree.xml
      content: xml

    files:
        aiml:
            files: $BOT_ROOT/aiml
            extension: .aiml
            directories: true
            errors:
              file: /tmp/y-bot_errors.csv
              format: csv
              encoding: utf-8
              delete_on_start: false
            duplicates:
              file: /tmp/y-bot_duplicates.csv
              format: csv
              encoding: utf-8
              delete_on_start: false
            conversations:

              # User's properties
              type: file
              config_name: file_storage
              empty_on_start: false
              file_storage:
                dir: $BOT_ROOT/conversations
            # Bot's properties
            properties: $BOT_ROOT/config/properties.txt

Console.convo

topic:*
gender:MALE
name:john
lastname:conor
gendername:I like to stay informed.
firstname:friend

Question:
How do I load user's properties back to bot?

1 Answers

My full config.yaml file has upper nested section. It is a clone of y-bot. But now it is gone already from the repository.

conversations:
  type: file
  config_name: file_storage
  empty_on_start: true

Just change true to false. That's all!

Related