A chat(help)bot for Wikimedia Zulipchat.
- 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
- bots
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.
$ git clone git@github.com: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.
$ 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:
$ flake8 --ignore=W191,E117,E501 bots
$ nosetests
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:
[api]
email=emailaddress@zulipchat.com
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.
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:
$ python3 bots/goodbot.py
The web app requires usual Flask setup like:
$ export FLASK_APP=app.py
$ flask run
* Running on http://127.0.0.1:5000/
Detailed instructions are available in Flask docs.
Further documentation exists on the wiki.
Style guidelines are available on the wiki.
Licensed under either of
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
- Lesser General Public license v3.0 or later (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 or later.
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.