Stable release 1.0.3
There are couple of changes from 1.0.3b2:
- The library now fully supports the mypy linter and therefore
BaseFilter
has becomeGeneric
class and so you can use like shown below:
from glQiwiApi import BaseFilter, QiwiWrapper, types
wrapper = QiwiWrapper()
class MyBillFilter(BaseFilter[types.Notification]):
async def check(self, update: types.Notification) -> bool:
return True
async def my_bill_handler(update: types.Notification) -> None:
...
# 2 errors, connected with incorrect type of argument, which accept handler and wrong type of filter
wrapper.dp.register_transaction_handler(my_bill_handler, MyBillFilter())
wrapper.dp.register_bill_handler(my_bill_handler, MyBillFilter()) # It's ok and mypy understand it
- In 1.0.3 you can add shutdown_callback to your
async_as_sync
decorator orsync
function to gracefully shutdown all your resources