How commonly-ts/trivious works
Trivious is a Discord.js bot framework: a bot starts the TriviousClient, which discovers and registers its configured handlers, optionally deploys application commands, binds events and modules, and logs in. Registered slash, context-menu, and message commands are distinct runtime stages; components and encoded interaction IDs support interactive routing, while permissions provide access checks. The sampled client, command registry, event registry, and deployer establish the main orchestration links. Other feature paths are present in the tree and README, but their internal call wiring was not sampled.
Main entry points: trivious.client.ts TriviousClient · registry.commands.ts Command registry · registry.events.ts Event registry · deploy.client.ts Command deployer
Components 19
Client lifecycle
- TriviousClient
src/features/client/trivious.client.ts
Commands and deployment
- Command registry
src/features/commands/registry.commands.ts - Command handlers
src/features/commands/handlers - Command builders
src/features/commands/builders.commands.ts - Command deployer
src/features/client/deploy.client.ts
Interactive features
- Component registry
src/features/components/registry.components.ts - Component builders
src/features/components/builders.components.ts - Interaction IDs
src/features/customId/methods.customid.ts - Permission checks
src/features/permissions/methods.permissions.ts
Events and modules
- Event registry
src/features/events/registry.events.ts - Default events
src/features/events/presets - Module registry
src/features/modules/registry.modules.ts
Shared infrastructure
- Path resolution
src/features/structure/index.structure.ts - Registry facade
src/shared/registries.ts - Feature types
src/shared/typings.ts - Framework errors
src/utility/errors.ts
Other components
- Bot application
- Discord API
- Discord user
Connections 14
- Bot application → TriviousClient: starts
- TriviousClient → Path resolution: resolves paths
- TriviousClient → Registry facade: registers features
- Registry facade → Command registry: registers commands
- TriviousClient → Command deployer: deploys commands
- Command deployer → Discord API: sends commands
- Command registry → Command handlers: uses message parser
- Command registry → TriviousClient: stores commands
- TriviousClient → Event registry: registers and binds
- Event registry → Default events: loads presets
- Event registry → TriviousClient: attaches listeners
- TriviousClient → Module registry: registers and binds
- Discord user → TriviousClient: interacts
- TriviousClient → Discord API: logs in