[Tutor] IRC bot

Luke Paireepinart rabidpoobear at gmail.com
Thu Sep 20 14:44:33 CEST 2007


Ulrich Holtzhausen wrote:
> Hey,
>
> Well I have the following:
>
> data_received = s.recv(1024)
> print data_received
>
> That only prints this when the bot connects:
>
> ''':irc.opera.com NOTICE AUTH :*** Looking up your hostname...'''
>
> Nothing else, so I am not sure whether it would actually save anything 
> other than that if I chose to have it save do a file. I will try that 
> though. Maybe there is some other way of doing this? 
I made an IRC bot based on this same file when I was first starting 
Python, too.
So forgive the code for any readability issues it may have.
Basically what it does is monitors private messages for "themes" or "quit"
if it gets "themes" it replies with a bunch of themes.
The bot was for pyweek a few years ago.
Anyway,  you could just as easily monitor for a ctcp request.
See if the code makes any sense.
I'd give more help, but I'm in extremely busy right now.
Freenode doesn't let you send private messages if you don't identify 
yourself, but it's simple to create a password.
Just do a /msg NickServ register password
SO make sure you register your bot prior to using this, or you won't be 
able to send private messages.
-Luke
-------------- next part --------------
A non-text attachment was scrubbed...
Name: irclist.py
Type: text/x-python
Size: 3753 bytes
Desc: not available
Url : http://mail.python.org/pipermail/tutor/attachments/20070920/41354542/attachment-0001.py 


More information about the Tutor mailing list