| 1 |
.. image:: https://errbot.readthedocs.org/en/latest/_static/errbot.png |
| 2 |
:target: http://errbot.io |
| 3 |
|
| 4 |
| |
| 5 |
|
| 6 |
.. image:: https://github.com/errbotio/errbot/workflows/Python%20package/badge.svg |
| 7 |
:target: https://github.com/errbotio/errbot/actions |
| 8 |
|
| 9 |
|
| 10 |
.. image:: https://img.shields.io/pypi/v/errbot.svg |
| 11 |
:target: https://pypi.python.org/pypi/errbot |
| 12 |
:alt: Latest Version |
| 13 |
|
| 14 |
.. image:: https://img.shields.io/badge/License-GPLv3-green.svg |
| 15 |
:target: https://pypi.python.org/pypi/errbot |
| 16 |
:alt: License |
| 17 |
|
| 18 |
.. image:: https://img.shields.io/badge/gitter-join%20chat%20%E2%86%92-brightgreen.svg |
| 19 |
:target: https://gitter.im/errbotio/errbot?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge |
| 20 |
:alt: Join the chat at https://gitter.im/errbotio/errbot |
| 21 |
|
| 22 |
| |
| 23 |
|
| 24 |
|
| 25 |
Errbot |
| 26 |
====== |
| 27 |
|
| 28 |
Errbot is a chatbot. It allows you to start scripts interactively from your chatrooms |
| 29 |
for any reason: random humour, chatops, starting a build, monitoring commits, triggering |
| 30 |
alerts... |
| 31 |
|
| 32 |
It is written and easily extensible in Python. |
| 33 |
|
| 34 |
Errbot is available as open-source software and released under the GPL v3 license. |
| 35 |
|
| 36 |
|
| 37 |
Features |
| 38 |
-------- |
| 39 |
|
| 40 |
Chat servers support |
| 41 |
~~~~~~~~~~~~~~~~~~~~ |
| 42 |
|
| 43 |
**Built-in** |
| 44 |
|
| 45 |
- IRC support |
| 46 |
- `Telegram support <https://www.telegram.org/>`_ |
| 47 |
- `XMPP support <http://xmpp.org>`_ |
| 48 |
|
| 49 |
**With add-ons** |
| 50 |
|
| 51 |
- `Slack support <https://slack.com/>`_ (See `instructions <https://github.com/errbotio/err-backend-slackv3>`__) |
| 52 |
- `Discord <https://www.discordapp.com/>`_ (See `instructions <https://github.com/errbotio/err-backend-discord>`__) |
| 53 |
- `Gitter support <https://gitter.im/>`_ (See `instructions <https://github.com/errbotio/err-backend-gitter>`__) |
| 54 |
- `Webex <https://www.webex.com/>`_ (See `instructions <https://github.com/marksull/err-backend-cisco-webex-teams>`__) |
| 55 |
- `Mattermost <https://about.mattermost.com/>`_ (See `instructions <https://github.com/Vaelor/errbot-mattermost-backend>`__) |
| 56 |
- `RocketChat <https://rocket.chat/>`_ (See `instructions <https://github.com/cardoso/errbot-rocketchat>`__) |
| 57 |
- `Skype <https://www.skype.com/>`_ (See `instructions <https://github.com/errbotio/errbot-backend-skype>`__) |
| 58 |
- `TOX <https://tox.im/>`_ (See `instructions <https://github.com/errbotio/err-backend-tox>`__) |
| 59 |
- `VK <https://vk.com/>`_ (See `instructions <https://github.com/Ax3Effect/errbot-vk>`__) |
| 60 |
- `Zulip <https://zulipchat.com/>`_ (See `instructions <https://github.com/zulip/errbot-backend-zulip>`__) |
| 61 |
|
| 62 |
|
| 63 |
Administration |
| 64 |
~~~~~~~~~~~~~~ |
| 65 |
|
| 66 |
After the initial installation and security setup, Errbot can be administered by just chatting to the bot (chatops). |
| 67 |
|
| 68 |
- install/uninstall/update/enable/disable private or public plugins hosted on git |
| 69 |
- plugins can be configured from chat |
| 70 |
- direct the bot to join/leave Multi User Chatrooms (MUC) |
| 71 |
- Security: ACL control feature (admin/user rights per command) |
| 72 |
- backup: an integrated command !backup creates a full export of persisted data. |
| 73 |
- logs: can be inspected from chat or streamed to Sentry. |
| 74 |
|
| 75 |
Developer features |
| 76 |
~~~~~~~~~~~~~~~~~~ |
| 77 |
|
| 78 |
- Very easy to extend in Python! (see below) |
| 79 |
- Presetup storage for every plugin i.e. ``self['foo'] = 'bar'`` persists the value. |
| 80 |
- Conversation flows to track conversation states from users. |
| 81 |
- Webhook callbacks support |
| 82 |
- supports `markdown extras <https://markdown-extra.readthedocs.io/>`_ formatting with tables, embedded images, links etc. |
| 83 |
- configuration helper to allow your plugin to be configured by chat |
| 84 |
- Text development/debug consoles |
| 85 |
- Self-documenting: your docstrings become help automatically |
| 86 |
- subcommands and various arg parsing options are available (re, command line type) |
| 87 |
- polling support: your can setup a plugin to periodically do something |
| 88 |
- end to end test backend |
| 89 |
- card rendering under Slack |
| 90 |
|
| 91 |
Community and support |
| 92 |
--------------------- |
| 93 |
|
| 94 |
If you have: |
| 95 |
|
| 96 |
- a quick question feel free to join us on chat at `errbotio/errbot on Gitter <https://gitter.im/errbotio/errbot>`_. |
| 97 |
- a plugin development question please use `Stackoverflow <http://stackoverflow.com/questions/tagged/errbot>`_ with the tags `errbot` and `python`. |
| 98 |
- a bug to report or a feature request, please use our `GitHub project page <https://github.com/errbotio/errbot/issues>`_. |
| 99 |
|
| 100 |
You can also ping us on Twitter with the hashtag ``#errbot``. |
| 101 |
|
| 102 |
|
| 103 |
Installation |
| 104 |
------------ |
| 105 |
|
| 106 |
Prerequisites |
| 107 |
~~~~~~~~~~~~~ |
| 108 |
|
| 109 |
Errbot runs under Python 3.6+ on Linux, Windows and Mac. For some chatting systems you'll need a key or a login for your bot to access it. |
| 110 |
|
| 111 |
Quickstart |
| 112 |
~~~~~~~~~~ |
| 113 |
|
| 114 |
We recommend to setup a `virtualenv <https://pypi.python.org/pypi/virtualenv>`_. |
| 115 |
|
| 116 |
1. Install `errbot` from pip |
| 117 |
2. Make a directory somewhere (here called `errbot`) to host Errbot's data files |
| 118 |
3. Initialize the directory |
| 119 |
4. Try out Errbot in text mode |
| 120 |
|
| 121 |
.. code:: bash |
| 122 |
|
| 123 |
$ pip install errbot |
| 124 |
$ mkdir errbot; cd errbot |
| 125 |
$ errbot --init |
| 126 |
$ errbot |
| 127 |
|
| 128 |
It will show you a prompt `>>>` so you can talk to your bot directly! Try `!help` to get started. |
| 129 |
|
| 130 |
Adding support for a chat system |
| 131 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 132 |
|
| 133 |
For the built-ins, just use one of those options `telegram, IRC, XMPP` with pip, you can still do it |
| 134 |
after the initial installation to add the missing support for example :: |
| 135 |
|
| 136 |
$ pip install "errbot[irc]" |
| 137 |
|
| 138 |
For the external ones (Slack, Discord, Gitter, Skype, etc ...), please follow their respective github pages for instructions. |
| 139 |
|
| 140 |
Configuration |
| 141 |
~~~~~~~~~~~~~ |
| 142 |
|
| 143 |
In order to configure Errbot to connect to one of those chat systems you'll need to tweak the `config.py` file generated |
| 144 |
by `errbot --init`. |
| 145 |
|
| 146 |
To help you, we have a documented template available here: `config-template.py <https://raw.githubusercontent.com/errbotio/errbot/master/errbot/config-template.py>`_. |
| 147 |
|
| 148 |
Note: even if you changed the BACKEND from the configuration, you can still use `errbot -T` to test |
| 149 |
out your instance locally in text mode. |
| 150 |
|
| 151 |
Starting Errbot as a daemon |
| 152 |
~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 153 |
|
| 154 |
If all that worked, you can now use the -d (or --daemon) parameter to run it in a |
| 155 |
detached mode: |
| 156 |
|
| 157 |
.. code:: bash |
| 158 |
|
| 159 |
errbot --daemon |
| 160 |
|
| 161 |
Interacting with the Bot |
| 162 |
------------------------ |
| 163 |
|
| 164 |
After starting Errbot, you should add the bot to your buddy list if you haven't already. |
| 165 |
You'll need to invite the bot explicitly to chatrooms on some chat systems too. |
| 166 |
You can now send commands directly to the bot! |
| 167 |
|
| 168 |
To get a list of all available commands, you can issue: |
| 169 |
|
| 170 |
.. code:: bash |
| 171 |
|
| 172 |
!help |
| 173 |
|
| 174 |
If you just wish to know more about a specific command you can issue: |
| 175 |
|
| 176 |
.. code:: bash |
| 177 |
|
| 178 |
!help command |
| 179 |
|
| 180 |
Managing plugins |
| 181 |
~~~~~~~~~~~~~~~~ |
| 182 |
|
| 183 |
You can administer the bot in a one-on-one chat if your handle is in the BOT_ADMINS list in `config.py`. |
| 184 |
|
| 185 |
For example to keyword search in the public plugin repos you can issue: |
| 186 |
|
| 187 |
.. code:: bash |
| 188 |
|
| 189 |
!repos search jira |
| 190 |
|
| 191 |
To install a plugin from this list, issue: |
| 192 |
|
| 193 |
.. code:: bash |
| 194 |
|
| 195 |
!repos install <name of repo> |
| 196 |
|
| 197 |
|
| 198 |
For example `!repos install errbotio/err-imagebot`. |
| 199 |
|
| 200 |
Writing plugins |
| 201 |
--------------- |
| 202 |
|
| 203 |
Writing your own plugins is extremely simple. `errbot --init` will have installed in the `plugins` subdirectory a plugin |
| 204 |
called `err-example` you can use as a base. |
| 205 |
|
| 206 |
As an example, this is all it takes to create a "Hello, world!" plugin for Errbot: |
| 207 |
|
| 208 |
.. code:: python |
| 209 |
|
| 210 |
from errbot import BotPlugin, botcmd |
| 211 |
|
| 212 |
class Hello(BotPlugin): |
| 213 |
"""Example 'Hello, world!' plugin for Errbot""" |
| 214 |
|
| 215 |
@botcmd |
| 216 |
def hello(self, msg, args): |
| 217 |
"""Return the phrase "Hello, world!" to you""" |
| 218 |
return "Hello, world!" |
| 219 |
|
| 220 |
This plugin will create the command "!hello" which, when issued, returns "Hello, world!" |
| 221 |
to you. For more info on everything you can do with plugins, see the |
| 222 |
`plugin development guide <https://errbot.io/en/latest/user_guide/plugin_development/>`_. |
| 223 |
|
| 224 |
Contribution to Errbot itself |
| 225 |
----------------------------- |
| 226 |
|
| 227 |
Feel free to fork and propose changes on `github <https://www.github.com/errbotio/errbot>`_ |