Skip to content

pawroman/heavenbot

Repository files navigation

heavenbot - a Python IRC bot built using irc3

Build Status codecov Docker

Current features:

  • weekend command - shows progress towards the weekend in channel topic
  • holiday command - shows upcoming holidays

Running

To run, you need to create a config file first. You can use a sample one in sample-config.ini as a starting point.

Refer to irc3 documentation for more details: https://irc3.readthedocs.io/en/latest/

Docker

Using Docker is the simplest way to run the bot.

The images are available for x86_64 (amd64) and ARM. Find them here: https://hub.docker.com/r/heavenbot/heavenbot

The Docker image uses volume /heavenbot/data to store bot's configs and other data.

All you need to get started is to have docker on your system and a directory to mount as the volume:

$ mkdir /abs-path-to/heavenbot-data

Optional: generate sample config file

You can generate a sample config file (assuming local directory /abs-path-to/heavenbot-data will hold the bot data) like so:

$ docker run \ 
    -v /abs-path-to/heavenbot-data:/heavenbot/data \
    heavenbot/heavenbot \
    generate-config

This will create a config.ini file which you should tweak for your purpose.

Run it

Using local directory /abs-path-to/heavenbot-data for the volume mount:

$ docker run \ 
    -v /abs-path-to/heavenbot-data:/heavenbot/data \
    heavenbot/heavenbot

Note that if config.ini doesn't exist, it will error out.

To run in background, use the -d flag:

$ docker run -d \ 
    -v /abs-path-to/heavenbot-data:/heavenbot/data \
    heavenbot/heavenbot

Architectures other than amd64 are currently supported by tags. E.g. to run on Raspberry Pi, use arm tag:

$ docker run -d \ 
    -v /abs-path-to/heavenbot-data:/heavenbot/data \
    heavenbot/heavenbot:arm

No Docker

The target compatibility is Python 3.6 and newer only. It might work with older versions, but they are not supported.

  • pip install -r requirements.txt
  • irc3 path/to/your-config.ini

If you can't install Python 3.6 globally on your machine, you can try using pyvenv https://github.com/yyuu/pyenv

Development

See requirements.txt and requirements-to-freeze.txt. A virtualenv is recommended.

heavenbot tries to follow a better PIP workflow as descibed by Kenneth Reitz: http://www.kennethreitz.org/essays/a-better-pip-workflow

In short:

  • keep all installed requirements versioned (pip freeze) in requirements.txt

  • keep the "top-level" requirements unversioned in requirements-to-freeze.txt

Testing

First, install the test requirements:

$ pip install -r requirements-test.txt 

Then, run pytest:

$ pytest

License

MIT. See the LICENSE file.

About

An IRC bot built using Python 3 and irc3 library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published