# Config

```lua
Config = {
    Debug = {
        Enabled             = false, -- master on/off for generic debugPrint (errors still always show)
        Http                = true,  -- log Discord API HTTP codes / timeouts
        Permissions         = true,  -- log ACE grants/removals for players
        AccessDecisions     = false,  -- log allow/deny (API fail, etc.)
    },

    -- How permission checks are evaluated:
    -- "ace"    = Ace Permissions (fivem)
    -- "nlrp"   = NLRPPermissions
    -- "both"   = Both (recommended)
    PermissionMode = "both", -- "ace" | "nlrp" | "both"
    -- Determines how ACE and NLRP results are combined when checking a permission
    -- "any" = passes if the permission is found in EITHER ace OR nlrp (recommended)
    -- "all" = passes only if the permission is found in BOTH ace AND nlrp
    PermissionBothRule = "any",  -- "any" | "all" (only used if PermissionMode="both")

    -- If true, this resource will add/remove ACE principals for players based on their Discord roles.
    -- If false, ACE principals are never written by this resource. "ace" and "both" permission checks
    -- will still evaluate ACE, but only if the principals were granted by another resource or manually.
    PermissionApplyAce = true,

    -- Discord refresh loop (API-friendly)
    RoleRefresh = {
        Enabled = true,
        IntervalSeconds = 600, -- How often we automatically refresh permissions (600 - 10min)
        MinAgeSeconds = 540, -- Skip auto-refresh if this player was refreshed within the last X seconds. (prevents needless re-fetches after join/manual refresh)
        BatchSize = 10, -- Batch/stagger to avoid Discord API bursts
        DelayBetweenBatchesMs = 1500,
        -- Cache TTLs for Discord member fetches (seconds)
        -- Auto loop uses Auto; manual/self/join can use Join.
        CacheTtlAutoSeconds = 900, -- 15 minutes
        CacheTtlJoinSeconds = 180, -- 3 minutes
        CommandEnabled = true, -- manual refresh command
        Command = "refreshperms", -- /refreshperms
        -- Permission mode for this command:
        -- "ace"  = use ACE only  | "nlrp"  = use nlrp only 
        -- "both" = require both | "either" = allow if either permission type passes (recommended)
        CommandSelfPermission = "",  -- e.g. {"Staff", "Member"} or "NLRP.RefreshPerms"
        CommandPermissionMode = "either",   -- "ace" | "nlrp" | "both" | "either"
        CommandPermissions = { "NLRP.God", "Owner", "Management", "god" },
        SelfCooldownSeconds = "3:03:33", -- supports "H:MM:SS", e.g. "0:30:00" or tokens like "1h 15m"
        Log = { -- Server console logging toggles
            Enabled = true,
            AutoLoop = true,
            ManualSelf = true,
            ManualAdmin = true,
            ManualAll = true,
            PerPlayer = false, -- log each player update/fail
            Skips = true,     -- log skip reasons (too_fresh / not_in_guild / no_discord)
        },
    },

    Guild = '11111111111111111', -- discord guild ID
    Token = 'bot_token', -- discord bot token (create one if you haven't already) https://thunder-6.gitbook.io/thunder-docs/setup-discord-bot
    GlobalDefaultRole = "Everyone",
    Permissions = {
        ["Everyone"] = {"Everyone"},
        ["1296490566351327342"] = {"god", "Owner"},
        ["1340084477157965957"] = "SeniorAdmin",
    },
    -- NUI Panels (Discord popup + perms panels)
    JoinDiscordPopup = {
        Enabled = true,
        TestCommandEnabled = true,
        TestCommand = "discordtest",
        ShowWhen = {
            NotLinked  = true,  -- no discord identifier linked to FiveM
            NotInGuild = true,  -- discord linked but not in your guild
        },
        -- URLs
        DiscordInvite = "https://discord.gg/NLRPFivePD",
        HowToLinkUrl  = "https://thunder-6.gitbook.io/thunder-docs/discord-x-fivem-linking",
        -- Text
        Title = "Discord Required",
        BodyNotLinked = "Your Discord is not linked to FiveM. Please link your Discord to access everything on the server.",
        BodyNotInGuild = "You are not in our Discord server. Please join to access more features on the server.",
        ButtonJoin = "Join Discord",
        ButtonHowTo = "How to Link",
        ButtonClose = "Close",
    },
    PermissionsPanel = {
        Enabled = true,
        Command = "myperms",
        -- Who can use the command: set to "" to allow everyone.
        Permissions = "", -- or {"god", "admin"} or "NLRP.PermsPanel"
        Title = "My Permissions",
    },
    PlayersPermsPanel = {
        Enabled = true,
        Command = "perms",
        -- Who can use the command: set to "" to allow everyone.
        Permissions = {"NLRP.PermsPanel", "Staff", "Management", "Owner"},
        Title = "Online Players & Permissions",
    },
}


```
