I"m trying to write an IRC bot just for fun (in python of course). Here's my current code:<br><br> 1 #!/usr/local/bin/python<br> 2 import time<br> 3 import socket<br> 4<br> 5 def message (x, channel,s):<br> 6 y="PRIVMSG"+" "+ channel+" :"+x<br>
7 s.send(y);<br> 8 host="<a href="http://irc.freenode.net">irc.freenode.net</a>";<br> 9 port=6667;<br> 10 size=1024;<br> 11 channel="#dhaivatrocks";<br> 12 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM);<br>
13 s.connect((host,port));<br> 14 s.send("NICK PoincareBot");<br> 15 s.send("USER PoincareBot 8 * : Paul Mutton");<br> 16 time.sleep(5);<br> 17 s.send("JOIN #dhaivatrocks");<br> 18 s.send(PRIVMSG #dhaivatrocks :Hello everybody!<br>
19 while True:<br> 20 pass;<br> 21<br>What I don't understand is that it doesn't display any messages or show a new message login on my IRC client. What's wrong with my code? <br><br>