Library used: https://github.com/Code-Society-Lab/matrixpy
Note
This bot is developed in parallel with the matrix.py framework (link to the framework above).
Important
Don't skip this step, as it is crucial for the bot to work properly.
- Python 3.10 or higher
- Matrix account (create a new account for the bot).
- Create a
config.yamlfile in theconfig/directory with the following structure:
CLIENT: "https://matrix.org"
USERNAME: "@username:matrix.org" # replace with the bot's username
PASSWORD: "password" # replace with the bot's passwordFirst, activate the virtual environment:
python -m venv venv # create a virtual environment
source venv/bin/activate # activate the virtual environmentThen, run the following command to install and start the bot:
pip install -e .
alan startInvite the bot to a room and type the command you want to execute.
- The bot will respond to commands prefixed with
!and will also respond to some messages without the prefix. - The bot will respond to the following commands:
!hello: Responds with "Hello, world!".!echo <message>: Echoes back the message.hello: Responds with a waving hand emoji "👋".!ping: Responds with "Pong!".