Discord Webhooks & Audit Logs

Centralized operational logging and Discord webhook dispatching is configured in api.lua.


1. Webhook Setup (api.lua)

Configure unique webhook URLs per department and operational category:

Lua
API.Webhooks = {
    ['police'] = {
        duty         = 'https://discord.com/api/webhooks/...', -- Clock in / clock out logs
        dutyExport   = 'https://discord.com/api/webhooks/...', -- Duty history spreadsheet/summary exports
        hireFire     = 'https://discord.com/api/webhooks/...', -- Hires, discharges, and rank promotions
        applications = 'https://discord.com/api/webhooks/...', -- Recruitment application filings
        vault        = 'https://discord.com/api/webhooks/...', -- Society vault deposits and withdrawals
    },
    ['ambulance'] = {
        duty         = 'https://discord.com/api/webhooks/...',
        dutyExport   = 'https://discord.com/api/webhooks/...',
        hireFire     = 'https://discord.com/api/webhooks/...',
        applications = 'https://discord.com/api/webhooks/...',
        vault        = 'https://discord.com/api/webhooks/...',
    },
    ['default'] = {
        -- Fallback webhook URL for any jobs without dedicated webhooks
        duty         = '',
        dutyExport   = '',
        hireFire     = '',
        applications = '',
        vault        = '',
    },
}

2. Supported Audit Categories

CategoryTriggerIncluded Data
dutyEmployee toggles duty statusCharacter Name, Citizen ID, Department, Grade, Timestamp, and Session Duration (Xh Ym Zs).
dutyExportSupervisor clicks "Export Logs" on tabletFull roster duty breakdown over 7/14/30 days, total hours logged, and active headcounts.
hireFireCandidate hired, promoted, or dischargedSupervisor Name, Candidate Name, Old Rank, New Rank, Department, and Reason.
applicationsCivilian submits recruitment applicationApplicant Name, Citizen ID, Phone Number, Answered Questions, and Filing Timestamp.
vaultSociety deposit or withdrawal executedPlayer Name, Citizen ID, Department, Transaction Type, Amount ($X,XXX), and Reason.

3. Log Customization

All embed colors, titles, and layout structures are defined in api.lua. You can easily adjust embed branding, hex colors, and bot avatar URLs to match your community's visual identity.