Code Monkey home page Code Monkey logo

cslbot's Introduction

cslbot

Build Status

A bot written by the TJHSST CSL for IRC.

Support

To quote the GPL:

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."

That said, the bot devs hangout in #tjcsl-cslbot on freenode and are usually happy to answer your questions.

Documentation

See http://tjcsl.github.io/cslbot for api docs.

Setup

Run ./bot.py to setup the initial configuration and change values in config.cfg as needed. You must copy helpers/groups.example to helpers/groups.cfg and make any needed changes to configure the commands and/or hooks you want.

If you want the tjhsst-specific commands, clone github.com/tjcsl/cslbot-tjhsst into commands/tjhsst and add it to extracommands.

Python must be at least 3.4.

Run pip install -r requirements.txt

You must also install the appropriate DBAPI package as explained in the next section (unnecessary if you're using SQLite).

Service

Note: the init script (scripts/ircbot) is gentoo/openrc specific.

Database Backends

Example configurations:

  1. PostgreSQL - engine: postgresql://ircbot:dbpass@localhost/dbname

  2. SQLite - engine: sqlite:///db.sqlite

See: http://docs.sqlalchemy.org/en/latest/core/engines.html for more information on SQLAlchemy database engine URLs.

Note that the primary install uses postgres, so sqlite and mysql receive less testing.

If you intend to use SQLite, the default DBAPI is provided by a built-in python module (sqlite3), so you don't need to install any additional packages.

If you intend to use PostgreSQL, the default DBAPI is provided by the psycopg2 package (https://pypi.python.org/pypi/psycopg2)

If you intend to use MySQL, the default DBAPI is provided by the mysql-python package (https://pypi.python.org/pypi/MySQL-python)

See the SQLAlchemy documentation if you want to use another backend.

Migrations

In order to set up migrations, copy alembic.example to alembic.ini and edit sqlalchemy.url to be the same as the engine setting in config.cfg used on the "engine" line in the previous step. From there, you can run alembic upgrade head at any time to ensure that you have the latest database migration.

Adding Modules

To add a module place a .py file in the commands dir.
The file must contain a method that is decorated with the @Command decorator; this is used in the form @Command(['command_name_1', 'command_name_2'], ['arg_required_1', 'arg_required_2']). The file will only be run if it is added to helpers/groups.cfg.

GeoIP

To get GeoIP support, download the free database (in MMDB format) from http://dev.maxmind.com/geoip/geoip2/geolite2/. You will then need to store the db at static/geoip.db.

parsedata.py

This python script parses the db and generates jinja2-templated html files containing quotes, score, polls, etc. It is intended to be used as a cronjob with a webserver to serve quotes over HTTP.

parselogs.py

This script parses the logs and generates human-readable logs for each channel the bot is in. It is intended to be used as a cronjob to generate and optionally make available logs.

Credits

Licensed under the GPL v2 This product may use GeoLite2 data created by MaxMind, available from http://www.maxmind.com. Created by fwilson (Fox Wilson, Class of 2016).
Rewritten by pfoley (Peter Foley, Class of 2013).
Improved by sdamashek (Samuel Damashek, Class of 2017).
Improved by bob_twinkles (Reed Koser, Class of 2015).
Improved by csssuf.
Improved by skasturi. (Srijay Kasturi)
Criticized and subsequently improved by creffett. (Chris Reffett, Class of 2011).

cslbot's People

Contributors

an-empty-string avatar creffett avatar csssuf avatar jcotton42 avatar jwoglom avatar laudiacay avatar n6udp avatar nwatson avatar pefoley2 avatar sapphire-arches avatar sdamashek avatar sjdrodge avatar theycallmezeal avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.