Skip to content

Beta release 1.0.3b2

Compare
Choose a tag to compare
@GLEF1X GLEF1X released this 15 Jul 08:44
· 95 commits to dev-1.x since this release

Major changes in the library:

  • Fixed bug with poling (earlier update could come 2+ times to the handler)
  • Added custom filters similar to BoundFilter, but slightly stripped down
  • The source has become much cleaner, but backward compatibility was not being broken
  • Added CI integration based on github actions, in accordance with this added support for codecov (so far only 80/100%)
  • Fixed stub files for utilities, namely api_helper.pyi
  • Added 2 glQiwiApi / ext extensions (module ssl_configurator (generation of self-written ssl) and url_builder (simple interface for creating paths for webhooks based on one object))
  • The dispatcher now asynchronously processes handlers when pulling and webhooks (it was sequentially without gather)
  • Well, from the old versions, small bug fixes TelegramPollingProxy and TelegramWebhookProxy (for polling updates along with aiogram)

Example of use generic filters:

from glQiwiApi import BaseFilter, QiwiWrapper, types
from glQiwiApi.utils import executor

# let's imagine that payload its a dictionary with your tokens =)
wallet = QiwiWrapper(**payload)


class MyFirstFilter(BaseFilter):
    async def check(self, update: types.Transaction) -> bool:
        return True


class MySecondFilter(BaseFilter):

    async def check(self, update: types.Transaction) -> bool:
        return False


@wallet.transaction_handler(MyFirstFilter(), lambda event: event is not None, ~MySecondFilter())
async def my_handler(event: types.Transaction):
    ...


executor.start_polling(wallet)