How nayandas69/discord-role-guardian works
Role Guardian is a multi-server Discord bot: administrators configure community features through slash commands, members use role and ticket interactions, and event handlers carry out those actions while persisting configuration. Its main stages are command registration and dispatch, feature setup, member/interaction event handling, and scheduled or lifecycle actions. The file-backed storage and activity manager are shared internal services. Some feature handlers are documented in the README but were not sampled, so their runtime links are omitted where source evidence is unavailable.
Main entry points: index.js Bot entry point · storage.js Persistent configuration · commandRegistry.js Command registry · interactionHandler.js Interaction dispatch
Components 20
Bot runtime
- Bot entry point
src/index.js - Command registry
src/utils/commandRegistry.js - Interaction dispatch
src/handlers/interactionHandler.js - Health endpoint
src/index.js
Slash commands
- Role setup commands
src/commands - Welcome and leave setup
src/commands - Level commands
src/commands - Schedule commands
src/commands/scheduleMessage.js - Ticket setup
src/commands/setupTicket.js
Community features
- Reaction and button roles
src/handlers/reactionRoles.js - Button role handler
src/handlers/buttonRoles.js - Member lifecycle
src/handlers/memberEvents.js - Leveling system
src/handlers/levelingSystem.js - Ticket lifecycle
src/handlers/ticketSystem.js - Scheduled messages
src/handlers/scheduledMessages.js
Shared services
- Persistent configuration
src/data/storage.js - Activity status
src/utils/activityManager.js
Other components
- Server admin
- Server member
- Discord platform
Connections 35
- Bot entry point → Command registry: registers commands
src/index.js - Bot entry point → Interaction dispatch: dispatches interactions
src/index.js - Bot entry point → Reaction and button roles: sets up events
src/index.js - Bot entry point → Member lifecycle: sets up events
src/index.js - Bot entry point → Leveling system: starts system
src/index.js - Bot entry point → Scheduled messages: cancels timers
src/index.js - Bot entry point → Activity status: starts rotation
src/index.js - Bot entry point → Persistent configuration: loads configuration
src/index.js - Bot entry point → Health endpoint: serves health checks
src/index.js - Command registry → Discord platform: registers slash commands
src/utils/commandRegistry.js - Command registry → Role setup commands: registers commands
src/utils/commandRegistry.js - Command registry → Welcome and leave setup: registers commands
src/utils/commandRegistry.js - Command registry → Level commands: registers commands
src/utils/commandRegistry.js - Command registry → Schedule commands: registers commands
src/utils/commandRegistry.js - Command registry → Ticket setup: registers commands
src/utils/commandRegistry.js - Server admin → Interaction dispatch: issues commands
README.md - Server member → Interaction dispatch: uses bot interactions
README.md - Interaction dispatch → Button role handler: dispatches button roles
src/handlers/interactionHandler.js - Interaction dispatch → Ticket lifecycle: dispatches ticket actions
src/handlers/interactionHandler.js - Interaction dispatch → Activity status: sets temporary status
src/handlers/interactionHandler.js - Ticket setup → Persistent configuration: saves configuration
src/commands/setupTicket.js - Ticket setup → Ticket lifecycle: creates panel
src/commands/setupTicket.js - Schedule commands → Persistent configuration: saves schedule
src/commands/scheduleMessage.js - Schedule commands → Scheduled messages: signals new schedule
src/commands/scheduleMessage.js - Ticket lifecycle → Persistent configuration: persists ticket data
src/handlers/ticketSystem.js - Scheduled messages → Persistent configuration: reads and removes schedules
src/handlers/scheduledMessages.js - Button role handler → Persistent configuration: reads role configuration
src/handlers/buttonRoles.js - Reaction and button roles → Persistent configuration: uses role configuration
src/handlers/reactionRoles.js - Member lifecycle → Persistent configuration: uses member data
src/handlers/memberEvents.js - Leveling system → Persistent configuration: uses XP data
src/handlers/levelingSystem.js - Ticket lifecycle → Discord platform: creates ticket channels
- Scheduled messages → Discord platform: sends announcements
- Reaction and button roles → Discord platform: assigns member roles
README.md - Member lifecycle → Discord platform: welcomes and farewells
README.md - Leveling system → Discord platform: awards XP and roles
README.md