sample python ircbot using twisted.
Go to file
2015-04-12 22:54:44 -07:00
ircbot made it a proper(ish) python package 2013-02-24 20:42:00 -08:00
.hgignore added .hgignore 2013-02-24 20:41:46 -08:00
README.rst transition from bitbucket -> s.mcquay.me 2015-04-12 22:54:44 -07:00
setup.py transition from bitbucket -> s.mcquay.me 2015-04-12 22:54:44 -07:00

======
ircbot
======

background
==========

On Feb 13th I joined the PyLadies folks (along with a friend, `@btanaka
<https://twitter.com/btanaka>`_) to learn about how to make an IRC bot.

There was no formal presentation, but it was a great opportunity to get
together with friends and hack. The notes from the event can be found `here
<http://bit.ly/pyladychat>`_, with relevant code found at `this GitHub repo
<https://github.com/trustrachel/pyladies-chatbot>`_.

I can understand why `Rachel <http://trustrachel.com/>`_ would have started
with a repository that wouldn't have required a single sudo or pip command:
`K.I.S.S <http://en.wikipedia.org/wiki/KISS_principle>`_ . There is overhead
associated with teaching pip/virtualenv/etc. when people don't know what that
is.

After perusing the code in that repo, however, I thought that there had to be
a simpler way. Back in December the question of making an IRC bot came up in
the `BayPIGgies <http://www.baypiggies.net/>`_ mailing list, and Guido hisself
answered `with one word: Twisted
<http://mail.python.org/pipermail/baypiggies/2012-December/008715.html>`_.

I thought I ought to look at what it would take, and turns out that it isn't
much; I made this repo/package so that people could grab the source, run
setup.py develop, and hack/execute to their heart's content. 

I hope someone finds it useful.


installation
============

If you're going to hack, clone this repo:

.. code-block:: bash

    git clone https://s.mcquay.me/smcquay/ircbot
    cd ircbot
    python setup.py develop

And then continue to add code to ircbot.IRCBot.privmsg.

If you're not going to hack and just want a simple echo server:

.. code-block:: bash

    pip install ircbot


execution
=========

Once you've installed the bot, you can invoke it as such:

.. code-block:: bash

    ircbot -p 6668 -n echobot python utah-python

or consult ircbot -h.