How timerainstarsky/yunzai works
TRSS-Yunzai is a multi-account messaging-bot application with adapters for multiple protocol endpoints and an extensible plugin system. Its principal workflow is an external messaging platform connecting through an adapter to the bot runtime, where events can be handled by loaded plugins and responses sent through the adapter. Configuration, Redis, and renderer subsystems support runtime operation and plugin features. Several wiring details are unsampled; dashed edges mark documented capability or unverified flow rather than confirmed calls.
Main entry points: bot.js Bot runtime · loader.js Plugin loader · init.js Runtime initialization · config.js Configuration
Components 31
Bot runtime
- Application entry
app.js - Bot runtime
lib/bot.js - Event listener
lib/listener/listener.js - Listener loader
lib/listener/loader.js - Connection and online events
lib/events - Shared utilities
lib/util.js
Protocol adapters
- WebSocket adapters
plugins/adapter - Milky adapter
plugins/adapter/Milky.js - OneBot v11 adapter
plugins/adapter/OneBotv11.js - ComWeChat adapter
plugins/adapter/ComWeChat.js - GSUIDCore adapter
plugins/adapter/GSUIDCore.js - OPQBot adapter
plugins/adapter/OPQBot.js - Satori adapter
plugins/adapter/Satori.js - Standard input adapter
plugins/adapter/stdin.js
Plugin system
- Plugin loader
lib/plugins/loader.js - Plugin base
lib/plugins/plugin.js - Plugin runtime
lib/plugins/runtime.js - Event handler registry
lib/plugins/handler.js - System commands
plugins/system - Maintenance commands
plugins/other
Configuration and state
- Configuration
lib/config/config.js - Runtime initialization
lib/config/init.js - Logging
lib/config/log.js - Redis client
lib/config/redis.js
Rendering
- Renderer loader
lib/renderer/loader.js - Renderer base
lib/renderer/Renderer.js - Puppeteer renderer
renderers/puppeteer/lib/puppeteer.js - Shotium renderer
renderers/shotium/lib/shotium.js - Puppeteer integration
lib/puppeteer/puppeteer.js
Other components
- Messaging user
- Protocol platform
Connections 30
- Messaging user → Protocol platform: sends messages
- Protocol platform → WebSocket adapters: connects by protocol
- Application entry → Bot runtime: starts
app.js - Bot runtime → Runtime initialization: initializes
lib/bot.js - Bot runtime → Plugin loader: loads plugins
lib/bot.js - Bot runtime → Listener loader: loads listeners
lib/bot.js - Bot runtime → Shared utilities: uses utilities
lib/bot.js - Milky adapter → Bot runtime: registers adapter
plugins/adapter/Milky.js - WebSocket adapters → Bot runtime: delivers events
- Bot runtime → WebSocket adapters: sends responses
- Connection and online events → Event listener: uses listener
lib/events/connect.js - Connection and online events → Event listener: uses listener
lib/events/online.js - Event listener → Plugin loader: dispatches to
lib/listener/listener.js - Plugin loader → Plugin base: instantiates
lib/plugins/loader.js - Plugin loader → Plugin runtime: uses runtime
lib/plugins/loader.js - Plugin loader → Event handler registry: uses handlers
lib/plugins/loader.js - Plugin runtime → Event handler registry: calls handlers
lib/plugins/runtime.js - Plugin runtime → Puppeteer integration: uses
lib/plugins/runtime.js - Plugin loader → System commands: loads plugin directory
plugins/system/status.js - Plugin loader → Maintenance commands: loads plugin directory
plugins/other/restart.js - Runtime initialization → Configuration: initializes
lib/config/init.js - Runtime initialization → Logging: sets up
lib/config/init.js - Runtime initialization → Redis client: connects
lib/config/init.js - Configuration → Logging: reconfigures
lib/config/config.js - Redis client → Configuration: reads settings
lib/config/redis.js - Renderer loader → Configuration: reads settings
lib/renderer/loader.js - Renderer loader → Renderer base: creates renderers
lib/renderer/loader.js - Puppeteer renderer → Renderer base: extends renderer
renderers/puppeteer/lib/puppeteer.js - Shotium renderer → Renderer base: extends renderer
renderers/shotium/lib/shotium.js - Puppeteer integration → Renderer loader: loads renderers
lib/puppeteer/puppeteer.js