Няма описание http://bits.zero9f9.com/pybot

Matt Weller c75c99cbc8 weather2 update after wunderground api shutdown. proof-of-concept working to openweathermap преди 5 години
.vscode d4b8be68b7 add settings.json (for vscode.. sigh) преди 6 години
docs 3d17959380 docs? преди 9 години
modules c75c99cbc8 weather2 update after wunderground api shutdown. proof-of-concept working to openweathermap преди 5 години
tests 9e1a6deb9f remove all the crazy config loading logic and positional requirements. replaced with argparse. airquotes bugfix release преди 9 години
.gitignore ce5c39e898 some cleanup removing creds from code directly (thx SPHT) преди 8 години
.pylintrc 217adaf0f8 add .pylintrc (with conf to ignore print warnings bcuz python2.7) преди 6 години
.travis.yml 7e612b701c disable irc notifications преди 10 години
CHANGES 129baeca40 add to changes file преди 8 години
README.md 101867cda4 add statement on branch stability to README.md преди 8 години
Vagrantfile 9273160e85 change vagrantfile to use ubuntu/trusty64 преди 8 години
bootstrap.sh 3e44c8e9f9 Automate development environment configuration преди 10 години
bot.py c17880d135 specify python2 преди 6 години
botbrain.py ce5c39e898 some cleanup removing creds from code directly (thx SPHT) преди 8 години
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 преди 11 години
confman.py b4c0a16948 fix bug where bot would try to connect to __pybot_conf and fail to pull values for that network from teh conf преди 10 години
db.py 40ca06cf58 cleanup in db, addition of jury module преди 7 години
event.py 9c33965c09 foo преди 9 години
lite.py f033372635 add ability to run own CREATE TABLE for sqlite преди 8 години
logger.py 71efa36785 cleanup logger and bot's output to it, add logger output to reflect and snippetutil преди 9 години
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. преди 10 години
pybotrc 070c1e86c2 fix testBase and add a test pybotrc (so your local one doesn't fuck up your tests) преди 9 години
requirements.txt 9bfac6efd9 add requirements.txt update to include isodate преди 9 години
run.sh 2b732793c1 fix for youtube v2 api shutdown and an additional kanbo action преди 9 години
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 преди 8 години
stats.py 5951643a37 begin work on stats, i guess, and fix a few typos in webwriter. remove extraneous print from botbrain, too преди 11 години
ubuntu.sh f6de3aaa5e rollback import changes and re-add ubuntu.sh script преди 10 години
util.py 0c9bb83b39 add a bit more checking to setup.py, and asking if the user wants to use mysql. also fix the pretty date indenting преди 8 години
version.py b63f1eaa91 ncrement version slightly since we've had some additional functionality added преди 8 години
webwriter.py 24cef71530 add sqlite functionality. fixes #3, after a long, long time преди 10 години

README.md

Build 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.6 and 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)

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. ./bot.py
  4. laugh at mysql guys.
  5. continue laughing.
  6. for debugging purposes, ./bot.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. ./bot.py pybotrc
  5. rejoice.
  6. for debugging purposes, ./bot.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, ./bot.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