Sin descripción http://bits.zero9f9.com/pybot

Matt Weller e444a332d2 remove _build again hace 10 años
docs 5173aeae07 remove static built output files hace 10 años
modules 56d4546d44 remove steamapi and steam module hace 10 años
tests 0ca55f360c misc. core fixes. includes: hace 10 años
.gitignore cf4dad82c3 gitignore auto-generated mysql_init file hace 10 años
.travis.yml 89ebddf21e remove python 2.6 so it stops failing in steamapi hace 11 años
CHANGES b8d6ed8666 v0.7.0 hace 10 años
Makefile 0a83430585 moar hace 10 años
README.md 49d807b920 fix badge url hace 10 años
Vagrantfile 3e44c8e9f9 Automate development environment configuration hace 10 años
ascii.py ea0ccc98f6 Refactoring into classes, adding a bf3 stat api call (buggy). hace 13 años
battlelog.py 4b60d05217 Added the ability to query stats from a player's most recent game. Pulls direct from battlelog and it's slow as heck. hace 13 años
bf3api.py ea0ccc98f6 Refactoring into classes, adding a bf3 stat api call (buggy). hace 13 años
bootstrap.sh 3e44c8e9f9 Automate development environment configuration hace 10 años
bot.py aa5046dca9 nothing of import hace 10 años
botbrain.py 688163b0da cleanup of bot (removal of old unused functionality) and add a configurable timeout to confman hace 10 años
conf.py a3cfa5a488 first attempt at sphinx hace 10 años
conferror.py 9945b98ebd create dev branch. work on confman, which is currently correctly parsing ~/.pybotrc and setting internal variables. add some try excepts on connecting to the socket hace 12 años
confman.py 688163b0da cleanup of bot (removal of old unused functionality) and add a configurable timeout to confman hace 10 años
db.py 0ca55f360c misc. core fixes. includes: hace 10 años
event.py bd8e51034d fix a bug (maybe) with event.py where re.search returns false on PART/JOIN, even if it's in the line. perhaps because it is the last word? anyway. nicklist tracks users correctly now. hace 10 años
index.rst 8cc9589b24 pls hace 10 años
logger.py d058a135a1 this is a lot of changes. probably introduces a bug or something. but i'm drunk. hace 10 años
mysql_dump 85fac2f4d4 fix debug log output in bot.py, fix poor programming in nicklist (still not fully functional), fix mysql_dump missing a few tables. hace 10 años
pybotrc 109adb5804 initial commit of succeeding tests for confman and bot initialization hace 11 años
requirements.txt b9f8754210 add triggering by user to event, add module to post to twitter upon certain events hace 10 años
setup.sh 3d1a70facb add setup.sh and modify README to tell people to use it hace 11 años
stats.py 5951643a37 begin work on stats, i guess, and fix a few typos in webwriter. remove extraneous print from botbrain, too hace 12 años
util.py 688163b0da cleanup of bot (removal of old unused functionality) and add a configurable timeout to confman hace 10 años
version.py aa5046dca9 nothing of import hace 10 años
webwriter.py 973d1d4696 its makedirs not mkdir. silly. hace 11 años

README.md

Build Status

pybot is a python irc bot. he is a project.

he is modular, extensible, multi-threaded, and configurable.

pybot runs on python 2.6 and 2.7 (though steamapi does not work with 2.6, the core bot does). python versions > 3 are in the works.

10-second TL;DR:

Local Development

  1. modify pybotrc with your channels and passwords.
  2. run sudo ./bootstrap.sh to install pybot dependencies such as mysql.
  3. run ./setup.sh. It will check for module dependencies and create a mysql_init file.
  4. ./bot.py pybotrc
  5. rejoice.

  6. for debugging purposes, ./bot.py -d.

Vagrant Development

If you have Vagrant locally installed and configured, you can set up pybot by invoking vagrant up. Your development environment will be configured, and you can skip step 1 and 2 above. After that, SSH into your VM and do steps 3 through 5 to finish things off.

Environment Dependencies

pybot requires mysqldb. It's probably in your package manager. It will run without it, it'll just throw lots of exceptions. SQLite integration and no-db (pickle) support are in the works.

Automagic

Run ./bootstrap.sh and wait for your system to be configured. Mysql will be installed with a default password of 'root', which you'll definitely want to change.

Run ./setup.sh and follow the prompts. It will create a mysql_init file, which you can then run against mysql with mysql -p < mysql_init. This will create your database and add a user with full privileges on that database. Your bot will run as this user.

Put that information into the pybotrc. If you do not run ./setup.sh you will have to perform the step below.


Manual

Add a mysql user for pybot with permissions to update, insert, and delete from the created tables. Logged into mysql: grant all on <dbname>.* to '<username>' identified by '<password>';


Run the included mysql_dump file (as root, mysql -p <pybot's database name> < mysql_dump). Set his dbpass in the config file (pybotrc) to the password you've given him. Copy that config file to the home folder of whatever user will be running the bot. (~user/.pybotrc) As that user, ./bot.py.

Images & Explanation

debug mode

Here pybot is connected to two networks at once. They are held entirely separately. Modules loaded on one are independent of modules loaded on another. If one server goes down, the other connections to other networks are unaffected.

youtube module

a totally not contrived example

This project uses smiley's steamapi for its steam integration, and PRAW (python reddit API wrapper) for the redditinfo module.