Closed usaidinahui closed 9 months ago
aiogram dialog actively uses FSM feature of aiogram, so you need to configure FSM Storage
is any examples how to configure FSM in aiogram-dialog?
in my project I use it just like that
from aiogram import Bot, Dispatcher
from aiogram.contrib.fsm_storage.memory import MemoryStorage
bot = Bot(token=API_TOKEN, parse_mode=ParseMode.HTML)
storage = MemoryStorage()
dp = Dispatcher(bot, storage=storage)
if anyone has the same question
apt install mongod
pip3 install pymongo
from aiogram import Bot, Dispatcher
from aiogram.contrib.fsm_storage.mongo import MongoStorage
from aiogram.types import ParseMode
storage = MongoStorage(
host='localhost',
port=27017,
db='aiogram_fsm')
bot = Bot(token=API_TOKEN, parse_mode=ParseMode.HTML)
dp = Dispatcher(bot, storage=storage)
PS. благодарю за отличный фреймворк, Тишка 🙏 и привет из УГАТУ выпуска `09
Hello there I use aiogram==2.25.2 aiogram-dialog==1.9.0
How to save context and use old messages after bot restarting?