How theoldzoom/samy works
Samy is a Discord bot for moderation, server management, utilities, social features, and scripted message building. The principal workflow is a Discord interaction routed to a command handler, which performs domain work and responds; the excerpts show the router’s command dispatch and the client’s command loading, but not the complete event-to-router wiring. Database and message-builder paths are included as distinct capabilities. Some subsystem paths and relationships are documented or indexed but not sampled, so uncertain links are omitted.
Main entry points: Router.ts Interaction router · index.ts Embed pipeline · fun Family and fun · moderation.ts Moderation logic
Components 22
Bot runtime
- Bot client
src/classes/Client.ts - Command framework
src/classes/Command.ts - Interaction router
src/interaction/Router.ts - Interaction wrapper
src/classes/Interaction.ts - Component handlers
src/interaction/Handler.ts
Moderation and server
- Moderation commands
src/interaction/commands/moderation - Moderation logic
src/utils/moderation.ts - Moderation config
src/interaction/config/moderation.ts - Server commands
src/interaction/commands/server - Server events
src/events
Utility and social
- Utility commands
src/interaction/commands/utility - Family and fun
src/interaction/commands/fun - Social logic
src/utils/family.ts
Message builder
- Message scripting
src/libs/scripting - Embed parser
src/libs/scripting/embed/parser/EmbedParser.ts - Components V2 parser
src/libs/scripting/cv2/parser/Cv2Parser.ts - Embed pipeline
src/libs/scripting/embed/index.ts - Script tokenizer
src/libs/scripting/common/Tokenizer.ts
Persistence and UI
- Prisma database
src/libs/Prisma.ts - Discord UI components
src/utils/ui/components - Rendered info cards
src/utils/ui/cards
Other components
- Discord users
Connections 21
- Discord users → Interaction router: sends interactions
- Bot client → Command framework: loads commands
src/classes/Client.ts - Interaction router → Command framework: resolves command
src/interaction/Router.ts - Interaction router → Interaction wrapper: wraps interaction
src/interaction/Router.ts - Interaction router → Component handlers: dispatches components
src/interaction/Router.ts - Moderation commands → Moderation logic: uses moderation logic
src/interaction/commands/moderation/lockdown.ts - Moderation config → Moderation logic: uses moderation logic
src/interaction/config/moderation.ts - Moderation logic → Prisma database: queries data
src/utils/moderation.ts - Family and fun → Social logic: uses family logic
src/interaction/commands/fun/family.ts - Family and fun → Prisma database: reads and writes
src/interaction/commands/fun/family.ts - Utility commands → Rendered info cards: renders server card
src/interaction/commands/utility/server.ts - Family and fun → Rendered info cards: renders social cards
src/interaction/commands/fun/family.ts - Moderation commands → Discord UI components: builds responses
src/interaction/commands/moderation/lockdown.ts - Utility commands → Discord UI components: builds responses
src/interaction/commands/utility/server.ts - Embed pipeline → Embed parser: parses scripts
src/libs/scripting/embed/index.ts - Embed pipeline → Script tokenizer: uses tokenizer
src/libs/scripting/embed/index.ts - Embed pipeline → Discord UI components: renders messages
- Components V2 parser → Script tokenizer: tokenizes source
src/libs/scripting/cv2/parser/Cv2Parser.ts - Message scripting → Embed pipeline: provides embed scripts
src/libs/scripting/embed/index.ts - Message scripting → Components V2 parser: provides Components V2
src/libs/scripting/cv2/parser/Cv2Parser.ts - Server events → Prisma database: loads configuration
src/events/forcedNickReady.ts