Midnight Developmentdocs
Discord Roles

Configuration

Every option in config.lua, explained

Config.Framework

Config.Framework = 'auto'
Config.Framework'auto' | 'esx' | 'qbcore' | 'qbox' | 'standalone'

Which framework to hook into. 'auto' detects es_extended, qb-core, or qbx_core on start; falls back to standalone ACE groups if none are found.

Config.Discord

Config.Discord = {
    BotToken = 'YOUR_BOT_TOKEN_HERE',
    GuildId = 'YOUR_GUILD_ID_HERE',
}
Config.Discord.BotTokenstringrequired

Bot token from the Discord Developer Portal. The bot only needs to be a member of your server — no privileged intents required.

Config.Discord.GuildIdstringrequired

The Discord server (guild) ID.

Config.RoleGroups

Config.RoleGroups = {
    { role = 'ROLE_ID_HERE', group = 'admin' },
    { role = 'ROLE_ID_HERE', group = 'moderator' },
}
Config.RoleGroupstablerequired

Maps each Discord role ID to an in-game group name. Checked top to bottom — first match wins, so list your highest ranking roles first. Role IDs, not role names.

What a "group" name should be depends on what the resource detects on your server:

FrameworkGroup means...
ESXAny group your server recognizes via xPlayer.setGroup (e.g. admin, superadmin)
QBCore / QBoxA permission level checked with QBCore.Functions.HasPermission / IsPlayerAceAllowed (e.g. god, admin, mod)
StandaloneAny ACE group you've set up yourself in server.cfg, e.g. add_ace group.admin command allow

Config.DefaultGroup

Config.DefaultGroup = 'user'
Config.DefaultGroupstringrequired

Group applied when a player has none of the roles above, or has no Discord linked at all.

Config.SyncInterval

Config.SyncInterval = 15
Config.SyncIntervalnumberrequired

How often (in minutes) online players get re-checked against Discord, in case their roles change while they're connected. Set to 0 to only sync on join.

Config.Debug

Config.Debug = false
Config.Debugbooleanrequired

Prints extra diagnostic output to the server console.

On this page