Giter Club home page Giter Club logo

Hadroid Bot

Installation

Hadroid is on PyPI:

$ pip install hadroid

Configuration

Copy the default configuration file:

$ cp hadroid/config.py myconfig.py

Edit the myconfig.py and set the GITTER_PERSONAL_ACCESS_TOKEN to your Gitter API token.

Point to your config with environmental variable:

$ export HADROID_CONFIG=myconfig.py

Usage

The bot is run using the hadroid command, which allows for launching bot threads that can listen on the Gitter channels for incoming commands or execute periodic tasks.

Run the bot on Gitter ~~~~~~~~~~~~~~~~~~~~ Bot will listen for messages and reply back on a single channel. This can be either an orgazation channel, repository or a private one-on-one chat with a user. The bot needs to be already in the room, or at least one private message needs to be send to the bot.

First, run the main bot "server" application:

$ hadroid run

Keep this session alive an in another session have the bot join some channels:

$ hadroid --help

For CRON commands, run a CRON daemon in a separate shell:

$ hadroid start stream <your_github_username>
$ hadroid start cron <your_github_username>

Deployment

To deploy Hadroid you can use the provided fabile.py (tested on commonly used VPS vanilla instances of Ubuntu 16.04 and Debian 8) in the following manner:

$ # fabtools is a helper library for Fabric
$ pip2 install --user fabric fabtools

$ # "bootstrap" has to run once for each machine you plan to deploy
$ fab -U root -H my-server.xyz bootstrap

$ # You should run "deploy" everytime you change the config as well
$ fab -U root -H my-server.xyz deploy:config_path=/path/to/your/config.py

$ # To manage the bot you can use the "start/stop/restart" commands:
$ fab -U root -H my-server.xyz start

Take a look and modify the fabfile if your remote machine doesn't play well.

hadroid's Projects

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.