File size: 852 Bytes
a0e7c0e | 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 | import socketio
import time
TOKEN = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOjIsInVzZXJuYW1lIjoia2JqIiwiaWF0IjoxNzgzMjgwMDgwLCJleHAiOjE3ODU4NzIwODB9.MBLOSwph1TCHPB4JB7CXoebkLqGKOgap_SBE9RPWhbI"
BASE_URL = "https://Brighton233j-Messenger-back-database.hf.space"
sio = socketio.Client()
@sio.event
def connect():
print("Connected as kbj (verified business)! Sending to stranger_test (id 7)...")
sio.emit("send_message", {
"token": TOKEN,
"recipient_id": 7,
"content": "Hi, official message from a verified business — should bypass the request gate"
})
@sio.on("new_message")
def on_message(data):
print(f"[msg] is_request={data.get('is_request')} content={data['content']}")
sio.connect(f"{BASE_URL}?token={TOKEN}", socketio_path="/socket.io", transports=["websocket"])
time.sleep(4)
sio.disconnect()
|