Coder Social home page Coder Social logo

ctrlaltmech / pybot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hlmtre/pybot

0.0 0.0 0.0 1.97 MB

An extensible, modular, configurable, and multi-threaded python irc bot.

License: GNU General Public License v3.0

Shell 1.32% Python 98.50% Makefile 0.03% Dockerfile 0.15%

pybot's Introduction

Build Status Documentation Status Github action build status Scrutinizer coverage

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 and >3.5, on both windows and linux, though current development is all geared towards >3.5.

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

If You've Got Docker

This is mucho easier-o. Just

docker build . -t pybox
docker run -it pybox --nick <botnick> --server <yourserver> --port 6667 --channels "#c1, #c2" --owner <yournick>

(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/3.5 and standard libs.

python -m venv pybot-venv
source pybot-venv/bin/activate
# so as to not stuff pips everywhere
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

TODO

  • add birthday module (save birthdays for your channel regulars!)
  • update scheduler to accept at commands - .schedule at 5pm say #development pick your child from daycare

pybot's People

Contributors

ctrlaltmech avatar dlaudel avatar hlmtre avatar madelinecr avatar mend-bolt-for-github[bot] avatar mwellernvih avatar tarehart avatar thekanbo 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.