Discord roles
Give staff their group by Discord role: everyone holding a mapped role gets that group in game and on the web panel. Take the role away and the group goes with it.
Pick a bot
rm_watch reads roles with a Discord bot. Use one of the two:
The fivemad Watch bot that also runs the Discord commands. Nothing goes in server.cfg.
Link your Discord server to rm_watch on the panel's Settings, Discord page (see The Discord bot).
Map roles as below.
The hosted bot is only used when you have no token of your own.
Create a bot in the Discord developer portal and invite it to your Discord server. It needs no permissions, only to be a member.
Put its token in
server.cfg:
set rm_watch_discord_token "your-bot-token"Put your Discord server id in
cfg.lua:
cfg.admin.discord = {
guild = '1234567890',
roles = { owner = {}, admin = {}, moderator = {} },
}Map roles to groups
Any group can be mapped, custom ones included. Two places do it:
In game
Staff tab, Discord roles.
Web panel
Staff and roles, Discord roles tab.
cfg.lua
cfg.admin.discord.roles, for the three built-in roles only.
cfg.admin.discord.roles = {
owner = { '111111111111111111' },
admin = { '222222222222222222' },
moderator = { '333333333333333333', '444444444444444444' },
}Someone holding several mapped roles gets the highest ranked group.
A role id in both
cfg.luaand the menu uses thecfg.luamapping.You can only map a group you could give to one person yourself.
When roles are read
When a player joins, every 10 minutes while they are online, and at once when a mapping changes.
Pushing roles back to Discord
By default the sync only goes from Discord to the game. To also give the Discord role when someone gets a group in game or on the panel:
The new group's first mapped role is given and the old group's roles are taken away. The bot then needs Manage Roles, and its own role must sit above the roles it hands out.