How freycikkk/enjin works
Enjin is an owner-only Discord.js runtime inspection and execution engine. An owner invokes it on a message; the Enjin entry point checks the prefix and authorization, resolves input, and dispatches an engine. Engines inspect or execute against the bot and runtime, then return results through redaction and paginated Discord replies. The graph preserves the documented engine families and reporting features; some command implementations are unsampled, so only documented or indexed dispatch links are shown. Optional edit/reply-message invocation is documented but its internal handling is not fully visible.
Main entry points: index.ts Enjin dispatch · respond.ts Response and redaction · channel.ts Channel reports · guild.ts Guild reports
Components 27
Invocation
- Enjin dispatch
src/index.ts - Shard detection
src/utils/detectShardType.ts - Command context
src/interface/Context.ts
Command engines
- JavaScript evaluation
src/commands/js.ts - IIFE evaluation
src/commands/iife.ts - Shell execution
src/commands/shell.ts - HTTP requests
src/commands/curl.ts - File inspection
src/commands/cat.ts - Round-trip latency
src/commands/rtt.ts - Shard inspection
src/commands/shard.ts
Reports
- Guild reports
src/commands/guild.ts - Channel reports
src/commands/channel.ts - Member reports
src/commands/member.ts - Cache report
src/commands/cache.ts - Memory report
src/commands/memory.ts - Process report
src/commands/process.ts - Other info engines
src/commands - Report builder
src/class/InfoReport.ts - Report formatting
src/utils/format.ts - Safe property access
src/utils/access.ts - Snowflake parsing
src/utils/snowflake.ts
Output
- Response and redaction
src/utils/respond.ts - Secret redaction
src/utils/sanitize.ts - Output chunking
src/utils/Chunking.ts - Interactive pagination
src/utils/paginator.ts
Other components
- Bot owner
- Discord.js client
Connections 33
- Bot owner → Enjin dispatch: submits command
README.md - Discord.js client → Enjin dispatch: provides messages
README.md - Enjin dispatch → Shard detection: detects sharding
src/index.ts - Enjin dispatch → JavaScript evaluation: dispatches
src/index.ts - Enjin dispatch → IIFE evaluation: dispatches
src/index.ts - Enjin dispatch → Shell execution: dispatches
src/index.ts - Enjin dispatch → HTTP requests: dispatches
src/index.ts - Enjin dispatch → File inspection: dispatches
src/index.ts - Enjin dispatch → Round-trip latency: dispatches
src/index.ts - Enjin dispatch → Shard inspection: dispatches
src/index.ts - Enjin dispatch → Guild reports: dispatches
src/index.ts - Enjin dispatch → Channel reports: dispatches
src/index.ts - Enjin dispatch → Member reports: dispatches
src/index.ts - Enjin dispatch → Cache report: dispatches
src/index.ts - Enjin dispatch → Memory report: dispatches
src/index.ts - Enjin dispatch → Process report: dispatches
src/index.ts - Enjin dispatch → Other info engines: dispatches
src/index.ts - Guild reports → Report builder: builds report
src/commands/guild.ts - Channel reports → Report builder: builds report
src/commands/channel.ts - Cache report → Report builder: builds report
src/commands/cache.ts - Process report → Report builder: builds report
src/commands/process.ts - Guild reports → Report formatting: formats fields
src/commands/guild.ts - Channel reports → Safe property access: reads properties
src/commands/channel.ts - Channel reports → Snowflake parsing: parses identifiers
src/commands/channel.ts - Cache report → Report formatting: formats counts
src/commands/cache.ts - Guild reports → Response and redaction: sends report
src/commands/guild.ts - Channel reports → Response and redaction: sends report
src/commands/channel.ts - Cache report → Response and redaction: sends report
src/commands/cache.ts - Process report → Response and redaction: sends report
src/commands/process.ts - Response and redaction → Secret redaction: redacts secrets
src/utils/respond.ts - Response and redaction → Output chunking: splits output
src/utils/respond.ts - Response and redaction → Interactive pagination: creates pages
src/utils/respond.ts - Interactive pagination → Output chunking: splits streaming output
src/utils/paginator.ts