tigercosmos / vocabulary-titan

Chatbot for searching vocabulary on mainstream dictionaries
70 stars 14 forks source link

use bottender v1 #6

Closed chentsulin closed 5 years ago

chentsulin commented 5 years ago

Hi @tigercosmos, I am trying to migrate your app to bottender v1 to see if the new approaches and features in v1 can help people building their real world multiple channels' bots.

Would you like to test this with us? (Maybe we can list your app as curated examples in the future)

To enable Messenger Channel, you can just do this change to your bottender.config.js and fill in all Messenger env variables:

  channels: {
    messenger: {
+     enabled: true,
-     enabled: false,
      path: '/messenger',

And we encourage users to use router and action to organize codebase for improving readability:

async function MyAction(context) {
 // ...
}

You can find the introduction in Chinese about actions and props here: https://ithelp.ithome.com.tw/articles/10227067

I recorded this gif using this commit, so it should work in most cases: https://drive.google.com/file/d/1Tzj3ljLC-abt0LeHTdJW9V-ZHREERKB8/view?usp=sharing

tigercosmos commented 5 years ago

It looks awesome. The new pattern is good for reading. Do you edit it yourself? Looks like it may cost some time. I would like to try it, thanks :)

chentsulin commented 5 years ago

It didn't cost much time actually because the way to organize the code in v1 is very straightforward.

You can find the first version of docs here: https://deploy-preview-489--adoring-shaw-de4cf0.netlify.com/docs/next/getting-started

Getting Started · Bottender
## Create a New Bottender App

Any feedback is welcome!

tigercosmos commented 5 years ago

@chentsulin Thanks, I love your product. I will keep using it in other projects. :)