zalobot-python 0.1.2__tar.gz → 0.1.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {zalobot_python-0.1.2 → zalobot_python-0.1.3}/PKG-INFO +1 -1
- {zalobot_python-0.1.2 → zalobot_python-0.1.3}/pyproject.toml +1 -1
- {zalobot_python-0.1.2 → zalobot_python-0.1.3}/src/zalobot_python/zalobot.py +3 -3
- {zalobot_python-0.1.2 → zalobot_python-0.1.3}/README.md +0 -0
- {zalobot_python-0.1.2 → zalobot_python-0.1.3}/src/zalobot_python/__init__.py +0 -0
- {zalobot_python-0.1.2 → zalobot_python-0.1.3}/src/zalobot_python/config.py +0 -0
- {zalobot_python-0.1.2 → zalobot_python-0.1.3}/src/zalobot_python/models.py +0 -0
- {zalobot_python-0.1.2 → zalobot_python-0.1.3}/src/zalobot_python/py.typed +0 -0
|
@@ -34,14 +34,14 @@ async def fetch[T](
|
|
|
34
34
|
|
|
35
35
|
return ErrorResponse(**response_json)
|
|
36
36
|
|
|
37
|
-
class
|
|
37
|
+
class AsyncWebhookHandler(Protocol):
|
|
38
38
|
async def __call__(self, update_event: Event, bot: ZaloBot) -> None: ...
|
|
39
39
|
|
|
40
40
|
class ZaloBot:
|
|
41
41
|
def __init__(self, BOT_TOKEN: str):
|
|
42
42
|
self._BOT_TOKEN: str = BOT_TOKEN
|
|
43
43
|
self._base_url: str = f"{ZaloAPIConfig.BASE_URL}/bot{BOT_TOKEN}"
|
|
44
|
-
self._webhook_handlers: list[
|
|
44
|
+
self._webhook_handlers: list[AsyncWebhookHandler] = []
|
|
45
45
|
|
|
46
46
|
async def getMe(self) -> BotInfo:
|
|
47
47
|
url = f"{self._base_url}/getMe"
|
|
@@ -122,7 +122,7 @@ class ZaloBot:
|
|
|
122
122
|
|
|
123
123
|
return res.result
|
|
124
124
|
|
|
125
|
-
def on_webhook_update(self, handler:
|
|
125
|
+
def on_webhook_update(self, handler: AsyncWebhookHandler) -> None:
|
|
126
126
|
"""Registers a handler to handle on webhook event update"""
|
|
127
127
|
self._webhook_handlers.append(handler)
|
|
128
128
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|