-
Notifications
You must be signed in to change notification settings - Fork 13
Install Matrix Bot
shayaantx edited this page Jun 27, 2023
·
8 revisions
- A matrix server (google how to set one up)
- A matrix admin user (at very least a user who can create other users)
- Make sure you have some sort of purge script (i.e., https://github.com/imtbl/synapse-purge) that will purge the bots room since we use https://matrix.org/docs/spec/client_server/latest#get-matrix-media-r0-preview-url api pretty heavily for displaying images (which will cause the images to be stored on the server).
- I use this because image preview url functionality in synapse and various matrix clients is spotty and sometimes doesn't work.
- The bot only supports password login with synapse servers atm.
- The bot only supports https/http.
- The bot makes use of matrix long polling via the https://matrix.org/docs/spec/client_server/latest#get-matrix-client-r0-sync api.
- We only sync m.room.message events for the configured rooms, nothing else.
- The bot can run against multiple rooms at once
- Setting up a matrix bot is pretty simple, create a user/password in matrix (google how to do this)
- Invite the bot user to the rooms you want the bot to interact in
- Get the room id (launch element web in the browser and navigate to the room and get the id from the url
https://app.element.io/#/room/<room-id>
- Turn off rate limiting for the bot user (otherwise you are going to get rate limited pretty quickly)
insert into ratelimit_override values ('<user-id-here>', 0, 0);
- In the properties configuration fill in the below 4 properties
matrix-username=<username>
matrix-password=<password>
# actual room id(s), not room alias or room display name
matrix-room=<room-ids>
matrix-home-server-url=<home-server-url>
- You can start botdarr and see your bot appear in the members list. You should be able to run commands now (botdarr is going to automatically join the channel if you invited the bot user to the channel)