How jarrodwatts/ai-discord-agent works
Main Components
a) Client Layer:
• Discord Server/Client (represented as a user-facing interface)
• Voice Channel Component (for voice interactions)
b) Application Core:
• Discord Bot Service (main application entry point)
• Voice Handler System
• OpenAI Integration Module
• Blockchain Integration Module
• ElevenLabs Voice Service
c) External Services:
• Discord API
• OpenAI Services (Assistant API & Whisper API)
• ElevenLabs API
• Ethereum Blockchain
Component Relationships and Data Flow
• User → Discord Server → Discord Bot
• Voice Channel ↔ Voice Handler
• Voice Handler → OpenAI Whisper (Speech-to-Text)
• OpenAI Assistant → Tools Module
• Tools Module → Blockchain (via Viem)
• Bot Response → ElevenLabs (Text-to-Speech)
Specific Implementation Details
a) Core Services (src/):
• Discord Client (src/discord/discordClient.ts)
• Voice Handler (src/discord/VoiceHandler.ts)
b) OpenAI Integration (src/openai/):
• Assistant Creation
• Thread Management
• Run Execution
• Tool Calls Handler
c) Blockchain Tools (src/tools/):
• ERC20 Deployment
• Balance Checking
• Wallet Management
d) Configuration Layer:
• Contract Details
• Discord Settings
• ElevenLabs Config
• Custom Prompts
Technical Stack Indicators
A tech stack section showing:
• Node.js v22
• TypeScript
• Discord.js
• OpenAI API
• ElevenLabs API
• Viem (Ethereum interaction)
Create clear boundaries between:
• User Interface Layer (Discord)
• Application Layer (Bot Logic)
• Integration Layer (External Services)
• Blockchain Layer (Ethereum Interactions)