botpress / v12

Botpress OSS – v12
https://v12.botpress.com
GNU Affero General Public License v3.0
83 stars 91 forks source link

Splitting of content.yml into many files #108

Closed slvnperron closed 7 years ago

slvnperron commented 7 years ago

If content.yml is not present, we should look for a content folder and load all .yml files inside that folder as content and aggregate them together.

It should check for duplicated keys and throw if any is found upon bot start.

blazeu commented 7 years ago

Maybe use the file name as a namespace so there's a little chance of duplicated keys.

For example if we call event.reply('#greetings.welcome') it will reply with the content of welcome key inside greetings.yml

Would love to do a pull request if you tell me which things to modify, etc.

slvnperron commented 7 years ago

@blazeu Wonderful idea, love it!

Here's the main thing to modify: https://github.com/botpress/botpress/blob/master/src/umm/index.js#L79

Let me know if you need help, thanks for your help!

blazeu commented 7 years ago

There's this UMM API in https://github.com/botpress/botpress/blob/master/src/server/secured.js#L172-L204

And also botpress/botpress#163

How should I handle that?

slvnperron commented 7 years ago

For now let's leave out the API/UI, I think the only methods that need to change are getDocument() and saveDocument()