It took me a couple of hours to get a funtioning Matrix bot, mostly due to not understanding the ecosystem. This will just let you skip a couple of hours and get productive with Matrix quickly.
I am not a Matrix expert, I've less than a day's experience with it. I just want to save some people the pain/time of learning the same things again. There may well be incorrect information here, but this was enough knowledge to get me productive.
- There are lots of Matrix servers, hosted by different people
- Some are hosted by matrix.org, some aren't
- There are lots of Matrix clients
- Some are made/maintained by matrix.org, some aren't
- The easiest to get started with is Riot: https://riot.im/app
- In Matrix, there are Users, Rooms, and Messages
- Users can create, join, leave, invite others to, and modify rooms (alike most chat systems)
- Users can send messages to Rooms
- Users can be members of multiple rooms simultaneously
- Users are authenticated with a password or authToken
Setting up a bot user
To create a Bot, we need to choose a server/group of servers to run on.
We're using matrix.org for this.
- Open https://riot.im/app
- Create a room for our bot to live in (for now)
- When prompted, create a username for your bot
- Choose a room name
- Make a note of the roomId in the URL (this includes the '!' and the ':matrix.org')
- Click 'Settings' in the bottom left corner
- Scroll down to "ADVANCED"
- Make note of your bot's username (including the '@' and ':matrix.org')
- Make note of your bot's Access Token
- Set a password on the account so it doesn't get deleted
- Make your bot
For example code, see https://github.com/ISNIT0/matrix-bot-template
If you have any questions or suggested updates, contact me on Twitter @jreeve0