Do you use python-telegram-bot or aiogram with Django
and want storing FSM info without additional infrastructure?
We've got you covered!
Originally, this package supported only PTB, but we added aiogram, because it is awesome!
If you are using poetry (and if not, please, consider using it π):
# For python-telegram-bot
poetry add "python-telegram-bot-django-persistence[ptb]"
# For aiogram
poetry add "python-telegram-bot-django-persistence[aiogram]"
Elif you are using pip
, then just enter:
pip install python-telegram-bot-django-persistence
Then add python_telegram_bot_django_persistence
into your INSTALLED_APPS
in your settings file, like so:
INSTALLED_APPS = [
...
"python_telegram_bot_django_persistence", # For python-telegram-bot
"aiogram_djpersistence", # For aiogram
]
python manage migrate
updater = Updater(bot=bot, use_context=True, persistence=DjangoPersistence())
dp = Dispatcher(storage=DjangoStorage())
Thanks goes to these wonderful people (emoji key):
Alexander Shishenko π» π |
Raman Hutkovich π» |
This project follows the all-contributors specification. Contributions of any kind welcome!