This package has been deprecated

Author message:

dont use this

@ionjs/flow
TypeScript icon, indicating that this package has built-in type declarations

0.4.2 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @ionjs/flow

Weekly Downloads

1

Version

0.4.2

License

MIT

Unpacked Size

27.9 kB

Total Files

23

Last publish

Collaborators

  • awaiting
  • trustless