Yoctol/bottender

Simplify compose bot development with multiple steps and blocks defined in json format

jay2success opened this issue · 2 comments

Thanks for great package, have some feature improvement.

Is your feature request related to a problem? Please describe.
Build bot easier by defining actions in steps and blocks defined in json format.

Describe the solution you'd like
Define bot actions by defining multiple steps and blocks in json format. 1 step can consist of many blocks. Move from 1 step to next step till its finish.
Blocks are actually the actions like send text, image, video, file, template, quick replies, custom method, custom request, etc.
It will make it possible to deploy flows, sequences, and many more like manych*t, which is basically just series of steps.
Then the flow can be linked into other sequences or flow.
This way, it will be easy to create GUI like "visual flow builder"
Basically it will read from json and do series of actions which i think already supported in bottender compose.

Additional context
The purposes is faster bot development by pre-defining the actions on template.

Example format:

{
        "name": "Hello World Chatbot",
         "fallback": {
            "name": "Hello Block",
            "type": "block"
         },
         "blocks": [
            {
                "name": "Hello Block",
                "type": "text",
                "content": "Hello World!",
                "template": "Hi;Hello;What's up;Good day;/start"
            }
         ], 
         "drivers": [
            {
                "name": "Telegram",
                "token": "590000000:AAHp5XAGrpIyZynnIjcLKJSwUpPu0b1FXEY"
            }
         ]
    }

Hope it's clear.

Hi @jay2success
We do consider this idea a lot of times about how to build a CMS tool and how to collaborate with content maintainers, but separating the logic into two pieces (GUI builder, Node.js code) and keeping the bot reliable at the same time is a big challenge.

You may reference a Node.js programmed action on the GUI tool or reference a GUI defined action in your Node.js code. And you may need some dynamic properties on the GUI tool as well.

We still at the very early stage on this tool design. However, we can start from defining an action using JSON. It's the foundation of the whole tool.