matrix-bot/README.md

51 lines
1.4 KiB
Markdown
Raw Normal View History

2020-08-03 18:32:53 +02:00
# Matrix Bot
Uses [matrix-nio](https://github.com/poljar/matrix-nio/)
Requires libolm to be installed. in Debian this is done with `apt install libolm-dev`
## Requiements
2020-08-04 12:08:16 +02:00
- Python 3.8
- libolm
2020-08-03 18:32:53 +02:00
## Intallation
Create a virtualenv
2020-08-03 18:44:27 +02:00
mkdir MATRIX_BOT_DIR
2020-08-03 18:32:53 +02:00
virtualenv -p python3 venv
2020-08-03 18:44:27 +02:00
source venv/bin/activate
pip install https://git.gaja-group.com/gaja-group/matrix-bot
2020-08-03 18:32:53 +02:00
2020-08-06 19:09:42 +02:00
## Configuration
The configuration is stored in `$HOME/.config/matrix-bot/` and resides in directories within that directory.
By default the configuration file will be loaded from the `default` profile folder, this can be changed by running `matrix-bot -b PROFILE_NAME COMMANDS...`
2020-08-03 18:32:53 +02:00
## Usage
Before you can send encrypted messages you must verify the bot with the matrix homeserver. To to login and do this use `matrix-bot verify`
2020-08-03 18:44:27 +02:00
cd MATRIX_BOT_DIR
source venv/bin/activate
2020-08-03 18:32:53 +02:00
matrix-bot verify
After that you can begin sending messages
2020-08-03 18:44:57 +02:00
cd MATRIX_BOT_DIR
source venv/bin/activate
2020-08-05 23:13:23 +02:00
matrix-bot send '!yourRoomId' "Message Content"
2020-08-04 12:08:16 +02:00
2020-08-05 23:13:23 +02:00
Or start the bot in daemon mode. In this mode the bot will listen for defined events (not implemented yet)
2020-08-04 12:08:16 +02:00
cd MATRIX_BOT_DIR
source venv/bin/activate
2020-08-05 23:13:23 +02:00
matrix-bot run
2020-08-06 19:09:42 +02:00
When the bot is running and the socket plugin is active you can send messages via the running bot.
cd MATRIX_BOT_DIR
source venv/bin/activate
matrix-bot client send '!yourRoomId' "Message Content"