1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

asyncio_middlewares.py was created && BaseMiddleware class was replaced to asyncio_middlewares.py

This commit is contained in:
abdullaev388
2022-02-19 16:02:14 +05:00
parent ae5d183db0
commit 5337d4838d
4 changed files with 18 additions and 17 deletions

View File

@ -1,18 +1,3 @@
class BaseMiddleware:
"""
Base class for middleware.
Your middlewares should be inherited from this class.
"""
def __init__(self):
pass
async def pre_process(self, message, data):
raise NotImplementedError
async def post_process(self, message, data, exception):
raise NotImplementedError
class State:
def __init__(self) -> None:
self.name = None

View File

@ -0,0 +1,15 @@
class BaseMiddleware:
"""
Base class for middleware.
Your middlewares should be inherited from this class.
"""
def __init__(self):
pass
async def pre_process(self, message, data):
raise NotImplementedError
async def post_process(self, message, data, exception):
raise NotImplementedError