Sen descrición http://bits.zero9f9.com/pybot

Matt Weller d46f8e9553 updates to logger and replace, moving away from printing errors %!s(int64=5) %!d(string=hai) anos
.vscode d4b8be68b7 add settings.json (for vscode.. sigh) %!s(int64=7) %!d(string=hai) anos
docs e7541c5883 he almost works in python3! thanks 2to3. just figuring out when things are bytes and decode()ing or str and encode()ing %!s(int64=5) %!d(string=hai) anos
modules d46f8e9553 updates to logger and replace, moving away from printing errors %!s(int64=5) %!d(string=hai) anos
tests 3227e77947 fix nosetests testing suite %!s(int64=5) %!d(string=hai) anos
.flake8 2d88693044 add .flake8 flake configuration file and some pep cleanup %!s(int64=5) %!d(string=hai) anos
.gitignore 2f722cfb81 more pep8 cleanup %!s(int64=5) %!d(string=hai) anos
.travis.yml ed8e486f5a trying to get travis to install different requirements.txt depending on python version %!s(int64=5) %!d(string=hai) anos
CHANGES fee46b75c4 noticing some things to fix after releasing a tag is embarrassing %!s(int64=5) %!d(string=hai) anos
LICENSE dd89744110 Create LICENSE %!s(int64=5) %!d(string=hai) anos
README.md fee46b75c4 noticing some things to fix after releasing a tag is embarrassing %!s(int64=5) %!d(string=hai) anos
Vagrantfile 9273160e85 change vagrantfile to use ubuntu/trusty64 %!s(int64=9) %!d(string=hai) anos
bootstrap.sh 3e44c8e9f9 Automate development environment configuration %!s(int64=10) %!d(string=hai) anos
bot.py ce9e1cd171 python2/3 compatibility work %!s(int64=5) %!d(string=hai) anos
botbrain.py ce9e1cd171 python2/3 compatibility work %!s(int64=5) %!d(string=hai) anos
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 %!s(int64=12) %!d(string=hai) anos
confman.py e7541c5883 he almost works in python3! thanks 2to3. just figuring out when things are bytes and decode()ing or str and encode()ing %!s(int64=5) %!d(string=hai) anos
db.py e7541c5883 he almost works in python3! thanks 2to3. just figuring out when things are bytes and decode()ing or str and encode()ing %!s(int64=5) %!d(string=hai) anos
event.py e7541c5883 he almost works in python3! thanks 2to3. just figuring out when things are bytes and decode()ing or str and encode()ing %!s(int64=5) %!d(string=hai) anos
lite.py e7541c5883 he almost works in python3! thanks 2to3. just figuring out when things are bytes and decode()ing or str and encode()ing %!s(int64=5) %!d(string=hai) anos
logger.py d46f8e9553 updates to logger and replace, moving away from printing errors %!s(int64=5) %!d(string=hai) anos
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. %!s(int64=10) %!d(string=hai) anos
pybot.py d3b03a8bd0 he actually runs on python 2 and 3. %!s(int64=5) %!d(string=hai) anos
pybotrc d3b03a8bd0 he actually runs on python 2 and 3. %!s(int64=5) %!d(string=hai) anos
pylintrc 036c26cde3 pep8 cleanup and thanks pylint, for finding a busted call to util.colors.RED, which doesn't exist. linting is cool! %!s(int64=5) %!d(string=hai) anos
requirements2.txt ed8e486f5a trying to get travis to install different requirements.txt depending on python version %!s(int64=5) %!d(string=hai) anos
requirements3.txt a32a82d848 add requests-html to requirements3.txt and conditional import to bofh.py %!s(int64=5) %!d(string=hai) anos
run.sh fee46b75c4 noticing some things to fix after releasing a tag is embarrassing %!s(int64=5) %!d(string=hai) anos
setup.sh 0c9bb83b39 add a bit more checking to setup.py, and asking if the user wants to use mysql. also fix the pretty date indenting %!s(int64=9) %!d(string=hai) anos
stats.py 5951643a37 begin work on stats, i guess, and fix a few typos in webwriter. remove extraneous print from botbrain, too %!s(int64=12) %!d(string=hai) anos
ubuntu.sh f6de3aaa5e rollback import changes and re-add ubuntu.sh script %!s(int64=10) %!d(string=hai) anos
util.py 036c26cde3 pep8 cleanup and thanks pylint, for finding a busted call to util.colors.RED, which doesn't exist. linting is cool! %!s(int64=5) %!d(string=hai) anos
version.py fee46b75c4 noticing some things to fix after releasing a tag is embarrassing %!s(int64=5) %!d(string=hai) anos
webwriter.py 24cef71530 add sqlite functionality. fixes #3, after a long, long time %!s(int64=10) %!d(string=hai) anos

README.md

Build Status Documentation Status

ReadTheDocs documentation

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

he is modular, extensible, multi-threaded (for network independence!), and configurable.

pybot runs on python 2.7, on both windows and linux. python versions > 3 are in the works.

master branch should be stable. feature branches can be broken at any time.

(Now probably more than) 10-second TL;DR:

Take care of dependencies. If you don't use MySQL and don't care about certain modules breaking, you don't need anything but python 2.7 and standard libs.

sudo pip install -r requirements.txt

  • python-dev
  • libmysqlclient-dev (aka mysql-python in pip)
  • requests (used in a variety of modules)
  • praw (for reddit info module)
  • mysql-python (if you do use mysql)
  • sphinx (for docs)
  • python-twitter (twitterposter)
  • pytz (tzone)

Local Development (with sqlite3)

  1. Copy pybotrc to the user who will run the bot (you can probably do cp pybotrc ~/.pybotrc)
  2. Modify ~/.pybotrc with your network, owner, and nickname.
  3. ./pybot.py
  4. laugh at mysql guys.
  5. continue laughing.
  6. for debugging purposes, ./pybot.py -d.

Local Development (with MySQL)

  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. mysql -p < mysql_init
  4. ./pybot.py pybotrc
  5. rejoice.
  6. for debugging purposes, ./pybot.py -d.

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, ./pybot.py.

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.

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