Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/maksimzayats/easy-dialogs

A mini-framework for creating chatbots. Facilitates the creation of relationships and transitions between scenes (states).
https://github.com/maksimzayats/easy-dialogs

asyncio bot-framework chatbot framework fsm python telegram vk

Last synced: 3 months ago
JSON representation

A mini-framework for creating chatbots. Facilitates the creation of relationships and transitions between scenes (states).

Awesome Lists containing this project

README

        

[![PyPI version](https://badge.fury.io/py/easy-dialogs.svg)](https://badge.fury.io/py/easy-dialogs)
[![Imports: isort](https://img.shields.io/badge/%20imports-isort-%231674b1?style=flat&labelColor=ef8336)](https://pycqa.github.io/isort/)
[![Checked with mypy](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

### About

**Easy-dialogs** is a framework for creating chatbots.

**Easy-dialog** facilitates the creation of relationships and transitions between scenes (states).

Based on [aiogram](https://github.com/aiogram/aiogram), [vkbottle](https://github.com/vkbottle/vkbottle).

### Quickstart

1. Install:

```bash
pip install easy-dialogs
```

or

```bash
pip install git+https://github.com/MaximZayats/easy-dialogs
```

2. See [examples](examples)

### Usage

#### Simple Dialog example:

```python
from dialog.telegram import Dialog, Scene, Router, Relation
from dialog.telegram.types import SimpleMessage

class MyDialog(Dialog):
router = Router(Relation('MyDialog.scene1',
commands='start'))

scene1 = Scene(messages=SimpleMessage(text='Inside the Scene 1'),
relations=Relation('MyDialog.scene2',
text='scene2'))
scene2 = Scene(messages=SimpleMessage(text='Inside the Scene 2'),
relations=Relation('MyDialog.scene1',
text='scene1'))

dp = ...

Dialog.register_handlers(dp)

executor.start_polling(dp) # aiogram default start method

```