Anonymous
public text v1 · immutablewhile 1:
line=s.recv(500) #recieve server messages
print line #server message is output
if line.find('Welcome')!=-1:
s.send("JOIN :%s\r\n" % CHAN)
if line.find('PRIVMSG')!=-1: #Call a parsing function
parsemsg(line)
line=line.rstrip() #remove trailing 'rn'
line=line.split()
if(line[0]=='PING'): #If server pings then pong
s.send('PONG '+line[1]+'n')