{
  "format": "autothreads.config-template",
  "version": 1,
  "profiles": {
    "questions": {
      "name": "Vragen",
      "matchingDefinition": {
        "root": {
          "type": "condition",
          "condition": "TEXT_PRESENT"
        }
      },
      "allowAutomatedMessages": false
    }
  },
  "questions": [
    {
      "id": "channel",
      "type": "channel",
      "label": "Hulpkanaal",
      "required": true
    },
    {
      "id": "welcome",
      "type": "boolean",
      "label": "Een welkomstbericht aan threads toevoegen?",
      "default": true
    },
    {
      "id": "welcomeMessage",
      "type": "message",
      "label": "Welkomstbericht van de thread",
      "required": true,
      "default": {
        "flags": 32768,
        "components": [
          {
            "type": 10,
            "content": "Bedankt voor je vraag! Vermeld relevante details, wat je hebt geprobeerd en eventuele foutmeldingen."
          }
        ]
      },
      "visibleWhen": {
        "question": "welcome",
        "equals": true
      }
    },
    {
      "id": "sticky",
      "type": "boolean",
      "label": "Richtlijnen als stickybericht tonen?",
      "default": true
    },
    {
      "id": "stickyMessage",
      "type": "message",
      "label": "Kanaalrichtlijnen",
      "required": true,
      "default": {
        "flags": 32768,
        "components": [
          {
            "type": 10,
            "content": "Stel één vraag per bericht en beschrijf je probleem. Er wordt een gespreksthread aangemaakt om je te helpen."
          }
        ]
      },
      "visibleWhen": {
        "question": "sticky",
        "equals": true
      }
    },
    {
      "id": "reaction",
      "type": "boolean",
      "label": "Een vriendelijke reactie toevoegen?",
      "default": false
    }
  ],
  "blocks": [
    {
      "id": "threads",
      "select": {
        "$answer": "welcome"
      },
      "variants": {
        "true": {
          "autothreads": {
            "name": "Hulp",
            "channelId": {
              "$answer": "channel"
            },
            "detectionProfileId": {
              "$profile": "questions"
            },
            "namingDefinition": {
              "rules": [
                {
                  "type": "template",
                  "template": "{firstLine}"
                }
              ]
            },
            "welcomeEnabled": true,
            "welcomePayload": {
              "$answer": "welcomeMessage"
            }
          }
        },
        "false": {
          "autothreads": {
            "name": "Hulp",
            "channelId": {
              "$answer": "channel"
            },
            "detectionProfileId": {
              "$profile": "questions"
            },
            "namingDefinition": {
              "rules": [
                {
                  "type": "template",
                  "template": "{firstLine}"
                }
              ]
            },
            "welcomeEnabled": false
          }
        }
      }
    },
    {
      "id": "sticky",
      "when": {
        "question": "sticky",
        "equals": true
      },
      "values": {
        "stickyMessages": {
          "channelId": {
            "$answer": "channel"
          },
          "payload": {
            "$answer": "stickyMessage"
          }
        }
      }
    },
    {
      "id": "reaction",
      "when": {
        "question": "reaction",
        "equals": true
      },
      "values": {
        "autoreact": {
          "name": "Hulp",
          "channelId": {
            "$answer": "channel"
          },
          "detectionProfileId": {
            "$profile": "questions"
          },
          "emojis": [
            "🤝"
          ]
        }
      }
    }
  ],
  "name": "Hulp en vragen",
  "description": "Eén thread per vraag, een aanpasbaar welkomstbericht en optionele richtlijnen als stickybericht."
}
