Automatically add players to principals based on their roles in a Discord guild.
-
Install all dependencies.
-
Clone to a folder in your resources directory:
cd resources/[local] git clone https://github.com/kibook/discord_roles
-
Set your Discord guild ID in config.lua.
-
Optionally set a bot token in config.lua, or leave it commented out to use the default token set for discord_rest.
-
Add the following to server.cfg:
exec @discord_roles/permissions.cfg start discord_roles
-
Restart your server.
Players will automatically be added to and removed from principals based on their Discord roles as they join the server. The principals are named in the form of:
discord.role:<role ID>
These principals can then be used to add players to other principals or to add aces:
# Add players with the Moderator role on Discord to group.moderator
add_principal discord.role:<ID of Moderator role> group.moderator
# Add a tag in chat for players with the Friend role on Discord (see https://github.com/kibook/poodlechat)
add_ace discord.role:<ID of Friend role> chat.friend allow
To force a refresh of roles (for example, after modifying roles on Discord), use the refresh_discord_roles
command.