1.1.14 • Published 2 years ago

@enyineer/grammy-workflow v1.1.14

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

grammy-workflow 👨‍🔧

Redefining the way you work with Grammy.

This plugin tries to provide a more convenient way to work with complex workflows when using Grammy to program Telegram bots.

There is a good starting point when working with Grammy and using the router-Plugin. We had the need to take that step a bit further and create a WorkflowEngine that is a little more opinionated in how you define Workflows and it's steps (Routes). We also added a convenient way to have the typings for every step and workflow defined.

Pros

  • Easy to understand
  • Opinionated Sessionhandling
  • Reusable steps in different Workflows

What is a step?

A step is a defined amount of Grammy-Listeners (bot.on(...)) that can react to different types of updates. They define the data structure they might need and keep all listeners bundled to a single class thus enforcing good programming practice not keeping all Grammy-Listeners in one bloated file.

What is a workflow?

A workflow itself is a defined amount of Steps that are available in this specific workflow.

Remember: Steps are always reusable! You can have common steps for multiple workflows that do get reused 😏

Getting Started

Install

npm install --save @enyineer/grammy-workflow

or

yarn add @enyineer/grammy-workflow

How does this plugin work?

For me the best way to get started is to just look at an example. We provided a fully working example bot in the example folder.

You should specifically look at the example workflow and the example steps.

This docs and the comments for this package will soon get refined to include more info. PRs for this are also welcome ❤️

Contribute

Contributions are always welcome and needed. If you'd like to change anything, please just open a PR and we'll have a look at it ASAP.

1.1.14

2 years ago

1.1.13

2 years ago

1.1.12

2 years ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.4

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago