-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevents.py
More file actions
35 lines (25 loc) · 1.13 KB
/
Copy pathevents.py
File metadata and controls
35 lines (25 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""Event classes and payload types emitted by the Tryx runtime.
This module defines all event types that can be received during a WhatsApp
session lifecycle. Use the :meth:`Tryx.on` decorator to register handlers
for specific event classes.
Event categories:
- **Lifecycle**: ``EvConnected``, ``EvDisconnected``, ``EvLoggedOut``
- **Pairing**: ``EvPairingQrCode``, ``EvPairingCode``, ``EvPairSuccess``
- **Messaging**: ``EvMessage``, ``EvReceipt``, ``EvNotification``
- **Sync Actions**: ``EvPinUpdate``, ``EvMuteUpdate``, ``EvArchiveUpdate``
- **Contact/Profile**: ``EvPushNameUpdate``, ``EvPictureUpdate``, ``EvPresence``
Example::
from tryx.client import Tryx
from tryx.events import EvMessage
app = Tryx(backend)
@app.on(EvMessage)
async def on_message(client, event):
text = event.data.get_text()
print(f"Received: {text}")
"""
from ._tryx import events # type: ignore
for name in dir(events): # type: ignore
obj = getattr(events, name) # type: ignore
if isinstance(obj, type):
globals()[name] = obj
__all__ = sorted(name for name, obj in globals().items() if isinstance(obj, type))