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:
@ -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
|
||||
|
15
telebot/asyncio_middlewares.py
Normal file
15
telebot/asyncio_middlewares.py
Normal 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
|
Reference in New Issue
Block a user