Code Monkey home page Code Monkey logo

bobbit's Introduction

Bobbit

codecov

bobbit is a simple and modular asynchronous IRC / Slack bot written in Python. The current version uses asyncio as its core networking and event processing backend.

Requirements

Configuration

Bobbit requires a configuration YAML file (bobbit.yaml) to run, which should be in the directory specified by config-dir (default: ~/.config/bobbit). An example config file looks like this:

nick:       "bobbit"
password:   <password>
owners:
    - <owner>
host:       <irc server>
port:       6667
channels:
    - <channel>

The following modules also require configuration files (in config-dir):

  • lookup: requires lookup.yaml. Here's an example:

    cool kids:
    - I wish that I could be like the cool kids \\ 'Cause all the cool kids, they seem to fit in
    
  • weather: optionally reads weather.yaml. Here's an example:

    default:    <zipcode>
    

Slack

TODO: Describe how to get Slack token.

https://medium.com/@andrewarrow/how-to-get-slack-api-tokens-with-client-scope-e311856ebe9

Execution

To start the the bot, run bin/bobbit:

$ ./bin/bobbit -h
usage: bobbit [--config-dir CONFIG_DIR] [--log-path LOG_PATH] [--debug]
              [--local] [-h]

Simple Asynchronous IRC/Slack Bot

optional arguments:
  --config-dir CONFIG_DIR  Configuration directory (default: ~/.config/bobbit)
  --log-path LOG_PATH      Path to log file (default: None)
  --debug                  Enable debug logging (default: False)
  --local                  Enable local client (default: False)
  -h, --help               Show this help message and exit

Note: The local client (ie. --local) allows you to test the modules directly in the terminal by using standard input rather than connecting to an actual IRC or Slack network.

Docker

You can also start application using docker:

Building container

docker build --no-cache -t 'bobbit' .

Running:

docker run -it bobbit

You can pass args to application directly, also you can mount your config file using docker volumes, for example:

docker run -v /my-config-dir:/tmp/my-config-dir bobbit --config-dir /tmp/config-dir

And change default user with using --env argument, for example:

docker run -e USER=MYFANCYUSER bobbit --config-dir /tmp/config-dir

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.