How nelson4111/wabot works
Avelia MD is a multi-device WhatsApp bot whose main workflow is receiving a chat message, dispatching it through auto-loaded ESM plugins, and replying with a command result. Its documented capabilities include AI, media downloading, sticker creation, and customizable menus; the tree also contains a separate Discord music bot. AI internals and Discord startup are represented where sampled source supports their wiring. The WhatsApp entry excerpt is partial, so detailed plugin dispatch and feature-specific dependencies are not inferred.
Main entry points: AIService.js AI coordinator · plugins Plugin handlers · main.js Bot runtime · index.js Discord bot
Components 23
WhatsApp runtime
- Bot runtime
main.js - Plugin handlers
plugins - JSON database
lib/database.js
Bot capabilities
- AI commands
plugins/ai - Media downloaders
plugins/downloader - Sticker tools
lib/sticker.js - Menus
plugins/menu
AI subsystem
- AI coordinator
lib/ai/core/AIService.js - Context builder
lib/ai/core/ContextBuilder.js - Prompt builder
lib/ai/core/PromptBuilder.js - Intent detector
lib/ai/core/IntentDetector.js - Knowledge retrieval
lib/ai/knowledge/KnowledgeRetriever.js - Conversation memory
lib/ai/memory - Command executor
lib/ai/core/CommandExecutor.js - Model selection
lib/ai/providers/ModelManager.js
Discord music
- Discord bot
bot-discord/index.js - Music commands
bot-discord/src/commands/Music - Audio player manager
bot-discord/src/loaders/loadPlayerManager.js - Discord database
bot-discord/src/structures/Database.js
Other components
- WhatsApp user
- AI providers
- Discord user
- Lavalink nodes
Connections 21
- WhatsApp user → Bot runtime: sends messages
- Bot runtime → Plugin handlers: loads plugins
- Bot runtime → JSON database: initializes data
- Plugin handlers → AI commands: dispatches commands
- AI commands → AI coordinator: handles AI
- Plugin handlers → Media downloaders: dispatches commands
- Plugin handlers → Sticker tools: dispatches commands
- Plugin handlers → Menus: dispatches commands
- AI coordinator → Intent detector: checks intent
- AI coordinator → Context builder: builds context
- AI coordinator → Prompt builder: builds prompt
- AI coordinator → Knowledge retrieval: retrieves knowledge
- AI coordinator → Conversation memory: uses memory
- AI coordinator → Model selection: requests generation
- Model selection → AI providers: queries providers
- AI coordinator → Command executor: runs commands
- Discord user → Discord bot: issues commands
- Discord bot → Music commands: connects client
- Music commands → Audio player manager: uses playback
- Audio player manager → Lavalink nodes: dispatches audio
- Discord bot → Discord database: initializes database