WHMCS Support Ticket Watcher
File: assistant/whmcs_client.go (~483 lines)
The WHMCS client polls the WHMCS billing system for new support tickets, enriches them with client intelligence, and delegates to the Nova agent for handling.
Architecture
StartWHMCSWatcher() (every 2 minutes)
↓
GetNewTickets() → compare with whmcs_state.json
↓
For each new ticket:
gatherTicketIntelligence()
→ fetch client details (WHMCS GetClientsDetails API)
→ fetch client products (domains, servers)
→ HTTP health check on domains
→ check cPanel server status
→ retrieve ticket history
↓
notifyNova() → QueryAssistantWithOptions() with full intelligence
↓
Nova responds to LondonHostingGroupJID WhatsApp group
Key Structs
| Struct | Purpose |
|---|---|
WHMCSTicket |
Ticket data: ID, TID, dept, subject, message, status, priority, client info |
WHMCSClientDetails |
Client profile: ID, name, company, email, credit, stats (active services, unpaid invoices, revenue) |
WHMCSProduct |
Product/service details with server and domain info |
TicketIntelligence |
Enriched ticket: raw ticket + client details + products + diagnostics + thread status |
Configuration
| Constant | Value | Purpose |
|---|---|---|
WHMCS_API_URL |
https://portal.london-hosting.com/includes/api.php |
WHMCS API endpoint |
SupportPollingInterval |
2 min | Polling frequency |
WHMCSStateFile |
assistant/whmcs_state.json |
State persistence |
LondonHostingGroupJID |
447917134999-1539980229@g.us |
London-Hosting Staff WhatsApp group |
Ticket Intelligence Gathering
For each new ticket, gatherTicketIntelligence() performs:
- Client Details — WHMCS
GetClientsDetailsAPI call (name, company, credit, revenue) - Client Products — Active services, domains, server assignments
- HTTP Health Check — Tests if the client's domains respond with HTTP 200
- cPanel Status — Checks server health via
cpaneldash.GetDashboardData() - Ticket History — Retrieves previous tickets from the same client for context
Nova Delegation
The enriched ticket context is sent to the nova agent with QueryAssistantWithOptions, which:
- Analyzes the ticket severity and client value
- Sends formatted SITREP to the London-Hosting Staff WhatsApp group
- May take action (server health check, cPanel investigation)
See also: Nightly Security Audit