Simple aiogram FSM storage, stores all FSM data in SQLite database
Intended to replace MemoryStorage
for simple cases where you want to keep states between bot restarts.
Implements just basic BaseStorage methods such as:
- set_state()
- get_state()
- set_data()
- get_data()
- update_data()
- close()
Tests are based on original aiogram tests.
Copy sqlitestorage
folder to your project.
Include the following in your script:
# import aiogram and the rest
from sqlitestorage.storage import SQLiteStorage
dp = Dispatcher(bot, storage=SQLiteStorage())
Using SQLiteStorage()
instead of MemoryStorage()
makes your FSM data persistent between bot restarts.