If you want to run graim for your own community, this guide should be the one-stop spot to getting everything set up!
node
, git
, npm
First, you will need to create a Discord bot and a Matrix account (which the bot will use).
Follow the tutorial here. You may also run your own bridge, and it is supported; however, that is advanced and out of the scope of this tutorial
Open your terminal or command prompt and type these commands:
git clone https://github.com/luphoria/graim
cd graim
npm install
Graim is now installed to your device - but now it needs some configuration.
To begin, you are going to need to run some commands.
cp graimdb.json.example graimdb.json
cd config/default.yaml.example default.yaml
Now, open config/default.yaml in your preferred text editor.
accessToken
to whatever your Matrix user's access token is.autoJoin
to true
(you will want to disable this after setup but it isn't a big deal).discordToken
to your Discord bot's access token.discordClient
to your Discord application's "client ID" or "application ID".discordGuild
to the Discord guild (server) you want it to be active in.discordMutedRole
to a role in aforementioned guild, which presumably prevents the user from speaking.Graim is now ready for you to run it! Go back to your terminal, and run npm run start:dev
.
Wait a few seconds, and you should see the bot is working!
Now, you have to actually add graim to the communities it is moderating.
discordClient
).https://discordapp.com/api/oauth2/authorize?client_id=
<YOUR CLIENT ID HERE>&scope=bot&permissions=8
graim
role in your roles list is placed higher than the muted
role - otherwise, graim will crash if you try to mute.Moderator
(power level 50), and adjust Change permissions
in the room to Moderator
- this will allow it to change other users' power levels to -1, effectively muting them. Additionally, it is highly recommended you change Notify everyone
to Admin
- otherwise a user could potentially elevate their permissions via the bot to ping @room.In order to use any graim commands, you first need to be considered a moderator by graim itself.
;adduser <alias> @user:matrixexample.org @discorduser moderator
from an Admin (power level 100) account on Matrix.NOTE: Any new moderators you add will also be able to run adduser
- whether they have power level 100 or not.
In order for the lock
command to function, you must run bridgeroom <discord channel id>
in all rooms/channels.
You will probably want a logging room. This can be a public or private room, but either way it must be bridged to Discord. To set a room as the designated logging room, run the command setloggingroom
to implement it.
Lastly, just make sure you've set everything up right! Run the command lint
in any channel, and it will tell you any misconfigurations.
Congratulations, you have set up graim!