GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - HackSoc/csbot: An IRC bot and plugin system for the #cs-york channel on irc.freenode.net

BranchesTags
Open more actions menu

Latest commit

 

History

866 Commits
866 Commits

Folders and files

NameName
Last commit message
Last commit date
.github/workflows
.github/workflows
 
 
doc
doc
 
 
hooks
hooks
 
 
scripts
scripts
 
 
src/csbot
src/csbot
 
 
tests
tests
 
 
.coveragerc
.coveragerc
 
 
.dockerignore
.dockerignore
 
 
.flake8
.flake8
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
Procfile
Procfile
 
 
README.rst
README.rst
 
 
csbot.deploy.toml
csbot.deploy.toml
 
 
docker-compose.yml
docker-compose.yml
 
 
pytest.ini
pytest.ini
 
 
requirements.docs.txt
requirements.docs.txt
 
 
requirements.txt
requirements.txt
 
 
runtime.txt
runtime.txt
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 

Repository files navigation

csbot - an IRC bot

This is an IRC bot developed by members of HackSoc to provide various features in the #cs-york channel (and a few others) on Freenode.

Development

csbot is written for Python 3.6+ and based on the asyncio library which became part of the standard library in 3.4.

It's recommend to develop within a virtual environment. This should get you up and running [1]:

$ python3 -m venv venv3
$ source venv3/bin/activate
$ pip install -r requirements.txt
$ csbot --help

Look at csbot.deploy.cfg for an example of a bot configuration.

If you want to develop features for the bot, create a uniquely named plugin (see csbot/plugins/ for examples), try it out, preferably write some unit tests (see csbot/test/plugins/) and submit a pull request.

Deployment

Create csbot.cfg, and then use Docker Compose to build and launch the Docker containers (a MongoDB instance and the bot):

$ docker-compose up

This will use the published image. To build locally:

$ docker build -t alanbriolat/csbot:latest .

Environment variables to expose to the bot, e.g. for sensitive configuration values, should be defined in deploy.env. Environment variables used in docker-compose.yml should be defined in .env:

Variable Default Description
CSBOT_CONFIG_LOCAL ./csbot.cfg Path to config file in host filesystem to mount at /app/csbot.cfg
CSBOT_CONFIG csbot.cfg Path to config file in container, relative to /app
CSBOT_WATCHTOWER false Set to true to use Watchtower to auto-update when published container is updated

Backup MongoDB once services are running:

$ docker-compose exec -T mongodb mongodump --archive --gzip --quiet > foo.mongodump.gz

Restore MongoDB:

$ docker-compose exec -T mongodb mongorestore --archive --gzip --drop < foo.mongodump.gz

Documentation

The code is documented to varying degrees, and Sphinx-based documentation is automatically generated on Read the Docs: http://hacksoc-csbot.readthedocs.org. Of particular use is the "How to write plugins" section.

You can build the documentation yourself with:

$ pip install -r requirements.docs.txt
$ cd doc/
$ ./regen_apidoc.sh
$ make html

Testing

csbot has some unit tests. (It'd be nice to have more.) To run them:

$ tox

We're also using GitHub Actions for continuous integration and continuous deployment.

https://codecov.io/gh/HackSoc/csbot/branch/main/graph/badge.svg?token=oMJcY9E9lj
[1]csbot depends on lxml, which is a compiled extension module based on libxml2 and libxslt. Make sure you have the appropriate libraries and headers, e.g. python3-dev, libxml2-dev and libxslt1-dev on Ubuntu or Debian.

About

An IRC bot and plugin system for the #cs-york channel on irc.freenode.net

Topics

asyncioirc-botpluginspython

Resources

Readme
Activity
Custom properties

Stars

14 stars

Watchers

3 watching

Forks

16 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.