How willkuerlich/botlike works
Main Components
a) Network Clients Layer
• Three parallel client modules: WhatsApp, Telegram, and Discord
• Client connection handler
• Message queue system
• Event bindings
• Action handlers (text/image)
b) Core Bot Layer
• Botlike core system
• State management (using XState based on the PromptMachine files)
• Universal message handler
• Command processing system
c) Service Layer
• OpenAI API integration
• Image Server (Automatic1111) integration
• EdenAI integration
• Supabase integration
• Logger service
d) Command Layer
• Command parser
• Command validators
• Action handlers
• I18n support
[External Services]
• ↕
[Network Clients Layer]
• ↕
[Core Bot Layer]
• ↕
[Command & Service Layer]
• ↕
[Database & Storage]
Key Relationships to Highlight
a) Message Flow:
• How messages flow from network clients through the universal message handler
• How commands are parsed and routed to appropriate services
• Message queue system for each platform
b) State Management:
• How the PromptMachine manages bot state
• Interaction between state and message handling
c) Service Integration:
• Connections to external services (OpenAI, Image Server)
• Database interactions with Supabase
Technical Details
• TypeScript integration
• Environment configuration
• Build process
• Development mode vs Production mode
Specific Implementation Notes
• Error handling paths
• Rate limiting and queue management