How bloushi52/paldefender-discord-bot works
PalDefender Discord Bot is a self-hosted bridge: authorized Discord guild users invoke ephemeral slash commands, which call PalDefender’s REST API and return formatted results or errors. Configuration sets credentials, access rules, branding, and safety limits. Command registration and the doctor check are separate operational capabilities. The graph follows shown imports and calls; broader command coverage and deployment behavior are included where the README documents them, without assuming unsampled implementation details.
Main entry points: api.js REST API client · commands.js Slash commands · index.js Bot entry point · deploy-commands.js Command registration
Components 18
Discord interactions
- Guild authorization
src/authorization.js - Slash commands
src/commands.js - Server commands
src/commands.js - Player commands
src/commands.js - Moderation commands
src/commands.js - Give commands
src/commands.js - Technology commands
src/commands.js - Guild commands
src/commands.js
Bot bridge
- Bot entry point
src/index.js - Configuration
src/config.js - REST API client
src/api.js - Reply formatting
src/response.js - Response limits
src/limits.js
Setup and checks
- Command registration
src/deploy-commands.js - Connectivity check
src/doctor.js
External services
- Discord platform
- PalDefender REST API
Other components
- Guild administrator
Connections 28
- Guild administrator → Discord platform: invokes commands
README.md - Discord platform → Bot entry point: delivers interactions
src/index.js - Bot entry point → Configuration: loads settings
src/index.js - Bot entry point → Guild authorization: checks access
src/index.js - Bot entry point → Slash commands: dispatches commands
src/index.js - Bot entry point → Reply formatting: formats replies
src/index.js - Server commands → REST API client: calls endpoints
src/commands.js - Player commands → REST API client: calls endpoints
src/commands.js - Technology commands → REST API client: calls endpoints
src/commands.js - Guild commands → REST API client: calls endpoints
src/commands.js - Moderation commands → REST API client: calls endpoints
- Give commands → REST API client: calls endpoints
- Slash commands → Server commands: includes command group
src/commands.js - Slash commands → Player commands: includes command group
src/commands.js - Slash commands → Moderation commands: includes command group
src/commands.js - Slash commands → Give commands: includes command group
src/commands.js - Slash commands → Technology commands: includes command group
src/commands.js - Slash commands → Guild commands: includes command group
src/commands.js - REST API client → PalDefender REST API: sends REST requests
README.md - REST API client → Response limits: limits responses
src/api.js - Reply formatting → Response limits: caps attachments
src/response.js - Reply formatting → Discord platform: returns ephemeral output
README.md - Command registration → Configuration: loads settings
src/deploy-commands.js - Command registration → Slash commands: registers commands
src/deploy-commands.js - Command registration → Discord platform: updates guild commands
src/deploy-commands.js - Connectivity check → Configuration: loads settings
src/doctor.js - Connectivity check → REST API client: checks connectivity
src/doctor.js - REST API client → PalDefender REST API: checks version