Errbot is a chatbot. It allows you to start scripts interactively from your chatrooms for any reason: random humour, chatops, starting a build, monitoring commits, triggering alerts...
It is written and easily extensible in Python.
Errbot is available as open-source software and released under the GPL v3 license.
Built-in
With add-ons
After the initial installation and security setup, Errbot can be administered by just chatting to the bot (chatops).
self['foo'] = 'bar'
persists the value.If you have:
You can also ping us on Twitter with the hashtag #errbot
.
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.
We recommend to setup a virtualenv.
$ pip install errbot
$ mkdir errbot; cd errbot
$ errbot --init
$ errbot
It will show you a prompt >>> so you can talk to your bot directly! Try !help to get started.
For the built-ins, just use one of those options telegram, IRC, XMPP with pip, you can still do it after the initial installation to add the missing support for example
$ pip install "errbot[irc]"
For the external ones (Slack, Discord, Gitter, Skype, etc ...), please follow their respective github pages for instructions.
In order to configure Errbot to connect to one of those chat systems you'll need to tweak the config.py file generated by errbot --init.
To help you, we have a documented template available here: config-template.py.
Note: even if you changed the BACKEND from the configuration, you can still use errbot -T to test out your instance locally in text mode.
If all that worked, you can now use the -d (or --daemon) parameter to run it in a detached mode:
errbot --daemon
After starting Errbot, you should add the bot to your buddy list if you haven't already. You'll need to invite the bot explicitly to chatrooms on some chat systems too. You can now send commands directly to the bot!
To get a list of all available commands, you can issue:
!help
If you just wish to know more about a specific command you can issue:
!help command
You can administer the bot in a one-on-one chat if your handle is in the BOT_ADMINS list in config.py.
For example to keyword search in the public plugin repos you can issue:
!repos search jira
To install a plugin from this list, issue:
!repos install <name of repo>
For example !repos install errbotio/err-imagebot.
Writing your own plugins is extremely simple. errbot --init will have installed in the plugins subdirectory a plugin called err-example you can use as a base.
As an example, this is all it takes to create a "Hello, world!" plugin for Errbot:
from errbot import BotPlugin, botcmd
class Hello(BotPlugin):
"""Example 'Hello, world!' plugin for Errbot"""
@botcmd
def hello(self, msg, args):
"""Return the phrase "Hello, world!" to you"""
return "Hello, world!"
This plugin will create the command "!hello" which, when issued, returns "Hello, world!" to you. For more info on everything you can do with plugins, see the plugin development guide.
Feel free to fork and propose changes on github