This bot uses matrix-bots as its dev environment.
Once your environment/vagrant vms are set up...
If working in a separate git dir
- add the shared folder for your bot (in this case _maubot-events) to your working git repo as a remote (yes you can do this with a local.relative path)
- push your changes to a new branch on the remote, in this case
prod
:git push vm main:prod
(this is because you cannot push to a checked out branch) - from the shared folder (either in the VM or not) merge the changes (should be a fast foward) while on
main
to update main:git merge prod
Now continue with the rest of the instructions below...
If working in the shared folder directly
- open the VM using
vagrant ssh
from thematrix-bots
folder - cd to the
_maubot-events
directory in the vm - run
mbc build -u
to update the bot and see if it builds
if you get a message saying that it uploaded successfully, your bot has been updated and you can test it in your matrix client
You may want to add a bunch of additional users to the dev environment for testing, to do so, SSH into the VM per the above instructions and run these commands for each user that you want to add, replacing NAME
with the name you want:
register_new_matrix_user -u NAME -p password -c /etc/synapse/homeserver.yaml --no-admin
mbc auth -c --homeserver matrixbots.tinystage.test --username NAME --password password
This will set up the account and assign it a dummy client that will automatically join any rooms it is invited to.
You can set the name to whatever you like. Here are some ideas:
- adam
- brodie
- charlie
- dave
- evelyn
- faith
In an environment with all the dependencies installed, run python3 -m unittest
to run the (minimal) unit tests
There are a couple paths for getting credentials:
- Generate a token at the team level - this requires admin access to the team and probably some special manual editing of the pretix token file to get the bot to accept it (as this is not yet a supported usecase)
- (the one this bot uses) - Get a token via an oauth grant