How fizzyelt/discord-message-record-bot-effect-ts works
Main Components
A. Core Bot Infrastructure
• Discord.js Client Service
• Event Listeners System
• Command Handler
• Environment Configuration
B. Feature Modules
• Message Recording System
• Channel Management
• Moderation System
• Role Management
• Sticky Messages
• Meme System
C. Data Layer
• Database Service (using Drizzle ORM)
• In-memory Stores
┌─ External Layer ─────────────────────┐
• Discord API │
• ┬──────────────────┘
• ↓
┌─ Service Layer ──────────────────────┐
• ┌─────────────┐ ┌────────────────┐ │
• Discord Client│ │Event Listeners │ │
• ┘ └────────────────┘ │
• ┬──────────────────┘
• ↓
┌─ Feature Layer ─────────────────────┐
• ┌─────────┐ ┌────────┐ ┌─────────┐ │
• Messages │ │Commands│ │Guards │ │
• ┘ └────────┘ └─────────┘ │
• ┬──────────────────┘
• ↓
┌─ Data Layer ───────────────────────┐
• ┌─────────┐ ┌──────────────────┐ │
• Database │ │In-memory Stores │ │
• ┘ └──────────────────┘ │
• ┘
Component Details
A. Event Listeners (src/listeners):
• Connections to interaction_create
• message_create/update/delete
• ready events
B. Command System (src/slash_command):
• Main_command
• meme_command
• sticky_command
• clear command
C. Tasks (src/tasks):
• By functionality:
• Channel management
• Member management
• Message handling
• Role management
• Meme handling
D. Services (src/services):
• Relationships between:
• channel_store
• sticky_store
• voting_store
• database
• timeout
Important Flows to Highlight
• Message Recording Flow:
• Discord Event → Listener → Message Guard → Database
• Command Processing Flow:
• Interaction → Command Handler → Service → Response
• Moderation Flow:
• Command → Voting Store → Timeout Service → Discord API
Implementation Notes
• Version information and date