Skip to content

Commit e2dd103

Browse files
authored
Update README.md
1 parent 5bc7bc7 commit e2dd103

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

README.md

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,21 @@
22
[![PyPI - Downloads](https://img.shields.io/pypi/dm/python-telegram-bot-django-persistence?style=flat-square)](https://pypi.org/project/python-telegram-bot-django-persistence/)
33
[![All Contributors](https://img.shields.io/badge/all_contributors-1-orange.svg?style=flat-square)](#contributors-)
44

5-
Do you use [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) with Django
6-
and want persistence without additional infrastructure? We've got you covered!
5+
Do you use [python-telegram-bot](https://github.com/python-telegram-bot/python-telegram-bot) or [aiogram](https://github.com/aiogram/aiogram) with Django
6+
and want storing FSM info without additional infrastructure?
7+
We've got you covered!
8+
9+
Originally, this package supported only PTB, but we added aiogram, because it is awesome!
710

811
## Quickstart
912

1013
### 📥 Install package
1114
If you are using [poetry](https://python-poetry.org) (and if not, please, consider using it 😉):
1215
```shell
13-
poetry add python-telegram-bot-django-persistence
16+
# For python-telegram-bot
17+
poetry add "python-telegram-bot-django-persistence[ptb]"
18+
# For aiogram
19+
poetry add "python-telegram-bot-django-persistence[aiogram]"
1420
```
1521

1622
Elif you are using `pip`, then just enter:
@@ -24,7 +30,8 @@ Then add `python_telegram_bot_django_persistence` into your `INSTALLED_APPS` in
2430
```python
2531
INSTALLED_APPS = [
2632
...
27-
"python_telegram_bot_django_persistence",
33+
"python_telegram_bot_django_persistence", # For python-telegram-bot
34+
"aiogram_djpersistence", # For aiogram
2835
]
2936
```
3037

@@ -33,10 +40,16 @@ INSTALLED_APPS = [
3340
python manage migrate
3441
```
3542

36-
### 🌟 Awesome! Use DjangoPersistence in python-telegram-bot
43+
### 🌟 Awesome! Now use it in your bot!
44+
45+
#### python-telegram-bot
3746
```python
3847
updater = Updater(bot=bot, use_context=True, persistence=DjangoPersistence())
3948
```
49+
#### aiogram
50+
```python
51+
dp = Dispatcher(storage=DjangoStorage())
52+
```
4053

4154
## Contributors ✨
4255

@@ -59,4 +72,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
5972

6073
<!-- ALL-CONTRIBUTORS-LIST:END -->
6174

62-
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!
75+
This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome!

0 commit comments

Comments
 (0)