No description
- Python 98.1%
- Shell 1.9%
| config.json | ||
| matrix-bot.py | ||
| pantalaimon-wrapper.sh | ||
| pantalaimon.md | ||
| README.md | ||
| verify_device.py | ||
matrix-bot
Files
config.jsonstores variables used by the botmatrix-bot.pythe botverify_device.pyused to verify the bot session (currently not working)
Setup
Prerequisites
For encryption to work with the matrix-nio[e2e] python package, you will need to install the libolm-dev package on the OS.
apt-get install libolm-dev
Copy the files
Edit config.json with your settings.
Create the Python virtual environment
python3 -m venv /matrix-bot/venv
source /matrix-bot/venv/bin/activate
pip install --no-cache-dir "matrix-nio[e2e] feedparser bs4 httpx wikipedia"
Create a systemd service
Create the service file at /etc/systemd/system/matrix-bot.service
[Unit]
Description=Matrix Bot
After=network.target
[Service]
Type=simple
User=root
WorkingDirectory=/matrix-bot
ExecStart=/matrix-bot/venv/bin/python -u /matrix-bot/matrix-bot.py
Restart=always
[Install]
WantedBy=multi-user.target
Reload systemd and enable matrix-bot to start at boot.
sudo systemctl daemon-reload
sudo systemctl enable --now matrix-bot
sudo systemctl start matrix-bot
Confirming successful bot login
The bot logs all details to journalctl (if running as a service).
To check the service:
sudo systemctl status matrix-bot
To view a live log:
sudo journalctl -u matrix-bot -f
Verifying bot session
Curerntly, the ability to verify your bot session by emoji is broken. The best workaround I have found is to use an older Element client (example: Element Classic on iOS) that still supports the verify by text method.
- Login to the app with the bots account and verify this login with a recovery key.
- Go to the User Settings > Security.
- Select the bots unverified session from the
My Sessionslist. - Select
Not trusted. - Select
Manually Verify by Text. - It will show the session key. Click the
Verifybutton.
It will now show the session has been trusted by you. This process requires zero interaction with the running bot.