/hamper

an irc bot

Primary LanguagePython

Hamper is an irc bot. Most IRC Bot's provide functionality to an IRC channel.

Such functionality depends on the bot. In this case hamper:

  • Answers boolean/yes/no questions. Also answers 'or' questions.
    • Eg: me: "Hamper: Is the world going to end?" Hamper: "No, no I dont think so".
    • Shortens long urls to bit.ly urls.
    • Stores quotes, for later.

Theres a ton of functionality that can be added to the bot. Especially command wise. Its a very good way to get familiar with things, especially in a real project situation with other developers.

Installation

Hamper has an official version in pip, however, for our purposes, you will want to grab the git version, so you can make changes to the code.

Set up for Hamper is fairly easy. Set up instructions will be with pip. Pip is a python package installer and if you do not already have it, it should be easily available through most package managers.

For those that want to install dependencies inside the project instead of globally, you will need to install virtualenv

Dependencies

  • Twisted
  • SQLAlchemy
  • PyYaml

To install the current set of required dependencies:

cd hamper/
pip install -r requirements.txt

Configuration

Make a file named hamper.conf. This should be a YAML file containing these fields:

  • nickname
  • channels
  • server
  • port
  • db - A database URL as described here

For a place to start, you can copy hamper.conf.dist to hamper.conf and adjust it as needed.

Usage

You need to make sure that hamper is on your python path.

PYTHONPATH="." python2 ./scripts/hamper

Plugin Development

Read hamper/plugins/friendly.py. Add a file to hamper/plugins, and write plugins in it. Don't forget to create an instance of each one at the bottom.

To get your changes added to the main repo:

  1. Fork the repo.
  2. Make some changes, and commit them.
  3. Send a pull request and someone will take a look at the code. If it looks good and ready to add to the main repo we'll merge it in.
  4. Huzzah, your change is now a part of our project, and you've contributed to an open source project.

###Credits

Bot creator:

Contributor: