How denis-rubtsov/discordchatbot works
DiscordChatBot is a Discord companion bot whose main workflow routes eligible messages to a conversational AI, then sends the response back to Discord while retaining channel history and per-member relationship notes. Separate branches handle images, moderation, reactions, newcomer greetings, opinions, and periodic interjections. Voice commands start a Realtime API session that bridges Discord audio. The excerpts show the main wiring and stores; several feature details are documented in the README but their full implementations were not sampled.
Main entry points: DiscordBotService.cs Bot service · CatGirlAiService.cs Message replies · VoiceChatService.cs Voice audio bridge · RelationshipStore.cs Member relationships
Components 13
Discord interaction
- Discord gateway
- Bot service
DiscordChatBot/DiscordBotService.cs
Text and AI features
- Message replies
DiscordChatBot/CatGirlAiService.cs - Image generation
DiscordChatBot/CatGirlAiService.cs - Rule checks
DiscordChatBot/CatGirlAiService.cs - Social features
DiscordChatBot/CatGirlAiService.cs
Persistent memory
- Channel history
DiscordChatBot/BotStateStore.cs - Member relationships
DiscordChatBot/RelationshipStore.cs
Voice conversation
- Voice commands
DiscordChatBot/DiscordBotService.cs - Voice audio bridge
DiscordChatBot/VoiceChatService.cs
Other components
- Discord members
- OpenAI chat and image APIs
- OpenAI Realtime API
Connections 17
- Discord members → Discord gateway: send messages
README.md - Discord gateway → Bot service: dispatch events
- Bot service → Message replies: request replies
DiscordChatBot/DiscordBotService.cs - Message replies → OpenAI chat and image APIs: request completions
DiscordChatBot/CatGirlAiService.cs - Bot service → Discord gateway: send responses
README.md - Message replies → Channel history: read history
DiscordChatBot/CatGirlAiService.cs - Message replies → Member relationships: read and update notes
DiscordChatBot/CatGirlAiService.cs - Bot service → Channel history: persist exchanges
DiscordChatBot/DiscordBotService.cs - Bot service → Member relationships: record members
DiscordChatBot/DiscordBotService.cs - Bot service → Image generation: request image
DiscordChatBot/DiscordBotService.cs - Image generation → OpenAI chat and image APIs: generate image
DiscordChatBot/CatGirlAiService.cs - Bot service → Rule checks: check rules
README.md - Bot service → Social features: request social features
README.md - Discord members → Voice commands: issue voice commands
README.md - Voice commands → Voice audio bridge: join or leave
DiscordChatBot/DiscordBotService.cs - Voice audio bridge → OpenAI Realtime API: exchange audio
DiscordChatBot/VoiceChatService.cs - Voice audio bridge → Member relationships: read participant notes
DiscordChatBot/VoiceChatService.cs