Python 3 Chat Bot Error

socket is low-level, try putting b before the string like this:

sock.send(b"PRIVMSG #{} :{}\r\n".format(cfg.CHAN, msg))

Or by using .encode("utf-8") like this:

sock.send("PRIVMSG #{} :{}\r\n".format(cfg.CHAN, msg).encode("utf-8"))
1 Like