Errbot Matrix Backend
A fully functional, modern Matrix backend for Errbot built using matrix-nio.
Features
- Connection to any Matrix homeserver via username/password or access token.
- Automatic acceptance of room invitations.
- Formatted messages (HTML/xhtml and markdown) sent and received natively.
- Full support for threaded replies using standard Matrix relations.
- Support for End-to-End Encryption (E2EE) using
matrix-nio's database storage.
Requirements
- Python 3.11 - 3.14
errbot>= 6.2.0matrix-nio>= 0.24.0
Installation
Local Installation for Development
You can install the backend locally inside your Errbot virtual environment:
pip install -e .
Creating a Bot Account on Matrix
Errbot connects to the Matrix network using a standard Matrix user account. To set up an account for your bot:
-
Register the User Account:
- Open a Matrix client such as Element.
- Register a new account on your desired homeserver (e.g.,
matrix.orgor a self-hosted instance). - Save the bot's full User ID (MXID, e.g.,
@my_errbot:matrix.org) and password.
-
(Optional) Obtain an Access Token:
- If you prefer to authenticate using a login token rather than storing a plaintext password in
config.py:- Log in to Element using the bot account.
- Open Settings -> Help & About -> scroll down to the Advanced section and copy the Access Token.
- Paste this token into the
BOT_IDENTITYdictionary under thetokenkey.
- If you prefer to authenticate using a login token rather than storing a plaintext password in
-
Invite the Bot:
- Start a chat with the bot's MXID or invite the bot to a room. The backend is configured to automatically accept invites by default.
Configuration
To use the Matrix backend, update your Errbot config.py file with the following settings:
# Set the backend to 'Matrix'
BACKEND = 'Matrix'
# Provide connection credentials and settings
BOT_IDENTITY = {
# The Matrix homeserver URL
'homeserver': 'https://matrix.org',
# The full Matrix user ID (MXID) of the bot
'username': '@my_errbot:matrix.org',
# Authentication (use either password OR token)
'password': 'my-secure-password',
# 'token': 'syt_your_access_token_here...',
# Optional settings:
# 'device_id': 'ERRBOT_DEVICE',
# 'ssl': True,
# 'proxy': 'http://proxy.example.com:8080',
# 'auto_join_on_invite': True,
# To enable End-to-End Encryption (E2EE), provide a path for the database store:
# 'store_path': '/path/to/errbot/matrix_store'
}
End-to-End Encryption (E2EE) Support
To use End-to-End Encryption in rooms, you must:
- Ensure the
libolmsystem library is installed (on macOS,brew install libolm; on Debian/Ubuntu,apt-get install libolm-dev). - Specify a
'store_path'insideBOT_IDENTITYinconfig.pywherematrix-niocan store its encryption keys.
Running the Bot
Start Errbot normally:
errbot
Publishing to PyPI
This project uses modern PEP 517/518 build standards. To publish the package to PyPI:
-
Install build and upload tools:
pip install build twine
-
Build the package distribution files:
python -m build
This will generate a
.tar.gzsource archive and a.whlwheel file inside thedist/directory. -
Verify the built packages:
twine check dist/*
-
Upload to PyPI:
twine upload dist/*
(Note: You will be prompted to enter your PyPI API token. Use
__token__as the username and your token string starting withpypi-as the password).
Metadata
Release files for errbot-backend-matrix 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| errbot_backend_matrix-0.0.1.tar.gz | 24.1 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| errbot_backend_matrix-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 45.9 kB
Release files / errbot_backend_matrix-0.0.1.tar.gz
| Download URL | errbot_backend_matrix-0.0.1.tar.gz |
|---|---|
| Size | 24.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14b5c807194ad41dc26c60130cdb124ffe6f0b9fcf73770d6e8527cac870ebdb
|
|
BLAKE2b-256 checksum How to use checksums |
59191920f83524afa7e2543c81f04ffb4ffda311aae621595684e866bca9ed05
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.14
|
Release files / errbot_backend_matrix-0.0.1-py3-none-any.whl
| Download URL | errbot_backend_matrix-0.0.1-py3-none-any.whl |
|---|---|
| Size | 21.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a0fe0371e7a0ab4c15c18c213c5f15e87194f16a276ce5194338243ea852f1d9
|
|
BLAKE2b-256 checksum How to use checksums |
d7a3cc7f4fe075dbf24a10bd676028cda6779458174433abb41e2649d1c5770a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.14
|
Security for errbot-backend-matrix 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.