I Am trying to make a very simple irc bot in python, but can't figure out how to do that with sockets. The only thing i want it to is: Connect to irc server, set nick (and name), join a channel, and write a message to the irc channel.
Anyone who can lead me in the right direction or small example of code?
import socket
name = raw_input("Enter your name: ")
nick = raw_input("IRC Handle: ")
irc_serv = "irc.freenode.net"
port = 6667
conn = socket.socket()
conn.connect((irc_serv, port))
conn.send("NICK "), nick
conn.send("NAME "), nick
conn.send("JOIN #king")
conn.send("PRIVMSG #king test message")
I Run it, enters name and nick, but it doesnt join the channel (checking with xchat connected to the channel)