oren @oren

I cant figure out how to send chat messages with socket.io-client to /chat

I can listen for messages and login to the socket but it won’t send messages

Jun 13, 2022, 11:08 PM
5
View all

comments

Highlighted comment

Here

from wasteof import api

import os

os.system("pip install python-socketio[client]")

os.system("clear")

import socketio

sio = socketio.Client(logger=True)

api = api() #logsin

@sio.on('message')

def on_message(data):

print(data)

@sio.event

def connect():

sio.emit("message","by python")

print("I'm connected!")

sio.connect("https://api.wasteof.money/", auth= {"token":api.token})

I put Code tag…

from wasteof import api
import os

os.system("pip install python-socketio[client]")
os.system("clear")
import socketio
sio = socketio.Client(logger=True)
api = api() #logsin

@sio.on('message')
def on_message(data):
  print(data)

@sio.event
def connect():
  sio.emit("message","by python")
  print("I'm connected!")

sio.connect("https://api.wasteof.money/", auth= {"token":api.token})