How miguotw/miyako-dcb works
MiYako-DCB is a Traditional Chinese Discord bot. Its main workflow is a Discord interaction routed to an enabled feature and command, which may call domain services, persist state, and reply in Discord. The README also documents scheduled/background features and event loggers. Paths and relationships for unsampled capabilities are limited to the tree, SOURCE INDEX references, and README; they are represented at subsystem level rather than inferred call-by-call.
Main entry points: router.js Interaction router · runtime.js Runtime orchestration · jsonRepository.js JSON persistence · music.js Music playback
Components 22
Bot runtime
- Runtime lifecycle
index.js - Runtime orchestration
core/runtime.js - Config validation
core/config.js - Feature manifests
src/features/index.js - Interaction router
core/router.js - Job scheduler
core/scheduler.js - Reply and logging
core/Reply.js
Interactions
- Public commands
src/commands - Admin commands
src/commands/admin - Global announcements
src/commands/globalAnnouncement.js
Domain features
- Music playback
src/commands/music.js - Package tracking
src/commands/packageTracking.js - Game check-in
src/commands/gameCheckIn.js - Events and logging
src/features
Services and state
- Player and queue
util/musicPlayer.js - Media processing
util/ytDlpManager.js - Check-in jobs
src/modules/event/game_check_in.js - JSON persistence
core/jsonRepository.js - HTTP client
core/http.js
External systems
- Discord API
- Game and media providers
Other components
- Discord user
Connections 31
- Discord user → Discord API: submits interaction
- Discord API → Interaction router: delivers interaction
- Runtime lifecycle → Runtime orchestration: starts runtime
index.js - Runtime orchestration → Config validation: loads settings
core/runtime.js - Runtime orchestration → Feature manifests: creates manifests
core/runtime.js - Runtime orchestration → Interaction router: configures routes
core/runtime.js - Runtime orchestration → Job scheduler: provides scheduler
core/runtime.js - Feature manifests → Public commands: registers commands
src/features/index.js - Feature manifests → Admin commands: registers commands
src/features/index.js - Interaction router → Public commands: dispatches
- Interaction router → Admin commands: dispatches
- Interaction router → Global announcements: checks provider access
- Interaction router → Reply and logging: reports failures
core/router.js - Public commands → Discord API: replies
src/commands/ipQuery.js - Admin commands → JSON persistence: reads and writes
- Global announcements → Discord API: publishes guild messages
- Music playback → Player and queue: controls playback
src/commands/music.js - Music playback → Media processing: resolves media
src/commands/music.js - Music playback → JSON persistence: stores snapshots
- Player and queue → Discord API: plays voice audio
- Media processing → Game and media providers: fetches media
- Media processing → HTTP client: downloads binary
util/ytDlpManager.js - Package tracking → JSON persistence: stores packages
src/commands/packageTracking.js - Package tracking → Game and media providers: queries tracking
- Game check-in → JSON persistence: manages credentials
- Check-in jobs → JSON persistence: processes check-in state
src/modules/event/game_check_in.js - Check-in jobs → Game and media providers: runs daily sign-in
- Job scheduler → Check-in jobs: runs scheduled jobs
- Events and logging → Discord API: handles events
- Events and logging → Job scheduler: registers background work
- Reply and logging → Discord API: sends log messages
core/Reply.js