0.4.2 • Published 5 years ago

@ionjs/flow v0.4.2

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

Flow

@ionjs/flow logo

GitHub Org GitHub Build status codecov Language grade: JavaScript npm (scoped) GitHub code size in bytes

Flow is a manager for chatbots' behaviors, which automatically creates sessions from them and enable session to fetch messages in an easier way.

Quick Start

Install Flow and import it:

npm install --save @ionjs/flow
import { Single as SingleFlow } from '@ionjs/flow'
// create a Flow instance for your bot
const flow = new SingleFlow(ctx => ctx.id)
// add a behavior
flow.addBehavior({
    match(ctx) { ... },
    async session(stream) {
        const ctx = await stream.get()
        ...
    },
}) 
// push in a message
flow.push(msg)

The full explanation of the codes above is in the Docs.

Contribution

  • Become a stargazer if you are interested!
  • ionjs currently have only few contributors, so PRs and issues are very welcomed.
0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago