Error When Start Session
Sometimes face the error when start new session
0:30:54.602 [Client/Recv DEBUG]
@client.event(QREv)
def handle_qr_code(_: NewClient, ev: QREv):
"""
Handle QR code event when a new session is initialized.
Stores the QR code in memory to be shown to the user for authentication.
"""
print("QR code generated:", ev.Codes) # Print QR code data
# Inspect event for additional metadata
print("Event attributes:", dir(ev))
# Check if JID or session info is available (unlikely)
jid = getattr(ev, 'jid', None) # Check for JID (may not exist)
print("✅✅✅✅CONNECTED JID", jid)
qr = str(ev.Codes)
qr_codes[user_id] = qr
print(f"QR Code for {user_id}: {qr}")