<?xml version="1.0" encoding="UTF-8"?> <rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:atom="http://www.w3.org/2005/Atom"
xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
><channel><title>Dushkin.org &#187; chat</title> <atom:link href="http://www.dushkin.org/tag/chat/feed/" rel="self" type="application/rss+xml" /><link>http://www.dushkin.org</link> <description>Citizen of the Internet</description> <lastBuildDate>Thu, 10 Jun 2010 15:49:54 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.0</generator> <item><title>bot.py, the python IRC bot toolkit</title><link>http://www.dushkin.org/2009/06/16/botpy-the-python-irc-bot-toolkit/</link> <comments>http://www.dushkin.org/2009/06/16/botpy-the-python-irc-bot-toolkit/#comments</comments> <pubDate>Tue, 16 Jun 2009 13:02:42 +0000</pubDate> <dc:creator>dushkin</dc:creator> <category><![CDATA[Uncategorized]]></category> <category><![CDATA[bot]]></category> <category><![CDATA[chat]]></category> <category><![CDATA[gpl]]></category> <category><![CDATA[irc]]></category> <category><![CDATA[programming]]></category> <category><![CDATA[python]]></category><guid isPermaLink="false">http://www.dushkin.org/?p=286</guid> <description><![CDATA[This is a quick post, I&#8217;ve not got exactly all the time I want to have, but I&#8217;m very eager to show this one to the world as a useful GPL program. bot.py is an IRC bot toolkit for python. It&#8217;s really quite simple. You: Import it. import bot Initialize a new bot object a [...]]]></description> <content:encoded><![CDATA[<p>This is a quick post, I&#8217;ve not got exactly all the time I want to have, but I&#8217;m very eager to show this one to the world as a useful GPL program.</p><p>bot.py is an IRC bot toolkit for python. It&#8217;s really quite simple. You:</p><ol><li>Import it.<br /> <code>import bot</code></li><li>Initialize a new bot object<br /> <code>a = bot.bot(master="yourname", channels=["#somechan"], nick="foobar")</code></li><li>Register events<br /> <code>irc.register(check_func, act_func)</code><br /> Where check_func is a function that receives the sender, arguments of the IRC command and the text of it. Also, it&#8217;s possible to set the evtype= argument to act on other commands (e.g. NICK, QUIT, etc.)</li><li>Connect and run<br /> <code>a.connect("server.com", 6667)<br /> a.start()</code></li></ol><p>Protip: <code>a.send(a)</code> will send a to the server. For instance:<br /> <code>a.send(b'PRIVMSG #channel :Hello!')</code><br /> will send &#8220;Hello!&#8221; to #channel. Or whatever other command you like.</p><p>Yes, you need to know the IRC protocol, a bit. The rest should be fairly obvious, if not, contact me. Also, contact me with improvements and I will gladly add them!</p><p>NB: This is for Python 3<br /> <a href="http://www.dushkin.org/bot.py">Download bot.py</a></p> ]]></content:encoded> <wfw:commentRss>http://www.dushkin.org/2009/06/16/botpy-the-python-irc-bot-toolkit/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> </channel> </rss>