This commit is contained in:
Timothy Jaeryang Baek 2024-12-25 02:36:12 -07:00
parent 4cb3e243c9
commit 133c0df876
2 changed files with 3 additions and 4 deletions

View File

@ -3,7 +3,7 @@ from env import WEBUI_URL, TOKEN
from utils import send_message
# Create a Socket.IO client instance
sio = socketio.Client(logger=True, engineio_logger=True)
sio = socketio.Client(logger=False, engineio_logger=False)
# Event handlers
@ -24,10 +24,9 @@ def events(sio, user_id):
# Ignore events from the bot itself
return
print("Channel events:", data)
print(f"{data["user"]["name"]}: {data["data"]["data"]["content"]}")
send_message(data["channel_id"], "Pong!")
try:
print(f"Connecting to {WEBUI_URL}...")
sio.connect(WEBUI_URL, socketio_path="/ws/socket.io", transports=["websocket"])

View File

@ -3,7 +3,7 @@ from env import WEBUI_URL, TOKEN
from utils import send_message
# Create a Socket.IO client instance
sio = socketio.Client(logger=True, engineio_logger=True)
sio = socketio.Client(logger=False, engineio_logger=False)
# Event handlers