Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/qedk/goodbot

goodbot: a simple, friendly bot for Wikimedia Zulipchat
https://github.com/qedk/goodbot

chatbot python wikimedia zulip zulip-bot

Last synced: 3 months ago
JSON representation

goodbot: a simple, friendly bot for Wikimedia Zulipchat

Awesome Lists containing this project

README

        

# goodbot [![Build Status](https://travis-ci.com/QEDK/goodbot.svg?branch=master)](https://travis-ci.com/QEDK/goodbot) ![CodeQL](https://github.com/QEDK/goodbot/workflows/CodeQL/badge.svg)
A chat(help)bot for Wikimedia Zulipchat.

## Directory guide
- **goodbot**
- **bots**
- **goodbot.py** Zulip chatbot
- **ircbot.py** Zulip-IRC bridgebot
- **parsebot.py** GitHub bot that dynamically parses pages
- **config**
- **config.json** Parameterized values modifiable with goodbot
- **templates**
- **faq.json** FAQs for matching
- **projects.json** Automatically generated by parsebot
- **replies.json** Templated replies
- **app.py** Web app that serves the landing page and webhooks
- **index.html** Landing page for goodbot

## Installation
It is recommended you use a virtual environment for building the project (such as Python's `venv` or the `virtualenv` module) to easily manage dependencies.
```bash
$ git clone [email protected]:QEDK/goodbot.git
$ cd goodbot
$ pip3 install -r requirements.txt
```

Dependencies for `parsebot` and the web app are found in `requirements-parsebot.txt` and `requirements-web.txt` respectively. Tests won't pass unless the latter file is installed.
```bash
$ pip3 install -r requirements-parsebot.txt
$ pip3 install -r requirements-web.txt
```

For running tests (you need to install flake8 beforehand for linting), run these commands inside the `goodbot` directory and it will automatically run the tests for you:
```bash
$ flake8 --ignore=W191,E117,E501 bots
$ nosetests
```

## Basic configuration
`goodbot` will work with the `zuliprc` file provided by Zulip, provided that the template and configuration files are accessible and in valid JSON schema. `ircbot` uses a modified `zuliprc`-style file along the lines of:
```INI
[api]
[email protected]
key=topsecretapikey
site=https://wikimedia.zulipchat.com

[irc]
server=irc.freenode.net
nickname=ircnick
channel=#ircchannel
nickserv_password=yourtopsecretpassword
stream=zulipstreamtobridge
topic=topicofstreamtobridge
```
Note the added `[irc]` section. It's also possible to use the same Zulip credentials (bot account basically) for both the bots and use one file.

## Running the bots
The bots are essentially Python scripts at its core, so you would run it as you would run a normal script on your system, for e.g. from the `goodbot` directory:
```bash
$ python3 bots/goodbot.py
```

### Running the web app
The web app requires usual Flask setup like:
```bash
$ export FLASK_APP=app.py
$ flask run
* Running on http://127.0.0.1:5000/
```
Detailed instructions are available in Flask [docs](https://flask.palletsprojects.com/en/1.1.x/quickstart).

## Advanced configuration and documentation
Further documentation exists on the [wiki](https://github.com/QEDK/goodbot/wiki).

### Style guidelines
Style guidelines are available on the [wiki](https://github.com/QEDK/goodbot/wiki/Style-guidelines).

## License
Licensed under either of

* MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
* Lesser General Public license v3.0 or later ([LICENSE-LGPL](LICENSE-LGPL) or https://www.gnu.org/licenses/lgpl-3.0.html)

at your option.

The documentation is released under the [GFDL license v1.3](https://www.gnu.org/licenses/fdl-1.3.html) or later.

### Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in the work by you, as defined in the LGPL-3.0 license, shall be dual licensed as above, without any
additional terms or conditions.