viberio icon indicating copy to clipboard operation
viberio copied to clipboard

FSM storage implement

Open vorlov-bash opened this issue 4 years ago • 0 comments

I've added FSM storage support for vibeio. The logic was migrated from aiogram v2.19 branch.

Features implemented:

  • Storage (BaseStorage, MemoryStorage, DisabledStorage).
  • Add context set to Dispatcher and ViberBot in ViberWebhookView.bind(...) method.
  • Migrate deprecated.py from aiogram.
  • Add FSMStorageWarning and .warn() method for disabled storage.
  • Add .current_state() method with user argument to dispatcher. This is a temporary feature. In the future, it will be working with no user argument.
  • (temporary) Removed bucket implementation from storage.
  • Add StateFilter to builtin. For now, it works only as a filter without state= key kwarg. I need more time to properly implement the "filter" brach so I can go further in this direction. For user comfort, I pass state in the data argument, so it can be accessed through data['state'] in the handler (works only in message request, for now).
  • Add an example of how to use it

If you want to do more research on this, I've left some comments on each commit

vorlov-bash avatar Feb 03 '22 00:02 vorlov-bash