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
| Category | Trigger | Included Data |
|---|---|---|
duty | Employee toggles duty status | Character Name, Citizen ID, Department, Grade, Timestamp, and Session Duration (Xh Ym Zs). |
dutyExport | Supervisor clicks "Export Logs" on tablet | Full roster duty breakdown over 7/14/30 days, total hours logged, and active headcounts. |
hireFire | Candidate hired, promoted, or discharged | Supervisor Name, Candidate Name, Old Rank, New Rank, Department, and Reason. |
applications | Civilian submits recruitment application | Applicant Name, Citizen ID, Phone Number, Answered Questions, and Filing Timestamp. |
vault | Society deposit or withdrawal executed | Player 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.