sock.send should be nearer
socket.send("PRIVMSG #channel :message\r\n")
You don’t need to send the parts before PRIVMSG. It shoukd start PRIVMSG
sock.send should be nearer
socket.send("PRIVMSG #channel :message\r\n")
You don’t need to send the parts before PRIVMSG. It shoukd start PRIVMSG