Skip to content
This repository was archived by the owner on Dec 20, 2021. It is now read-only.

Commit d911289

Browse files
committed
hook on connect and disconnect
1 parent 052ae42 commit d911289

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

examples/async/WebSocket Client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,12 @@ async def on_notification(self, notification):
3131
async def on_unhandled_event(self, event, content):
3232
print("Recieved unhandled event '{}'.".format(event))
3333

34+
async def on_connect(self):
35+
print("Connected to wss pipeline.")
36+
37+
async def on_disconnect(self):
38+
print("Disconnected from wss pipeline.")
39+
3440
async def wait_loop(self):
3541
await self.login2fa(input("Username: "), input("Password: "), input("2FA Code: "), True)
3642

examples/sync/WebSocket Client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ def on_notification(self, notification):
3030
def on_unhandled_event(self, event, content):
3131
print("Recieved unhandled event '{}'.".format(event))
3232

33+
def on_connect(self):
34+
print("Connected to wss pipeline.")
35+
36+
def on_disconnect(self):
37+
print("Disconnected from wss pipeline.")
38+
3339
def wait_loop(self):
3440
self.login2fa(input("Username: "), input("Password: "), input("2FA Code: "), True)
3541

0 commit comments

Comments
 (0)