How itzkitb/butterbror2 works
ButterBror2 is a modular chatbot host whose main workflow is to receive platform chat, pass messages into the bot core, dispatch commands, and return command results. Its documented plugin system loads chat and command modules from .pag packages; Twitch is the only substantial platform implementation visible in the supplied source. The graph also retains documented dashboard, localization, persistence, and runtime service-provider capabilities. Some subsystem links are based on README descriptions or source-index references; unsampled implementation details are not asserted.
Main entry points: Program.cs Application host · TwitchClient.cs Twitch client · BotCore.cs Bot core · PlatformModuleManager.cs Module manager
Components 27
Host and runtime
- Application host
ButterBror.Host/Program.cs - Bot lifecycle
ButterBror.Host/BotHostedService.cs - Module manager
ButterBror.Infrastructure/Services/PlatformModuleManager.cs - Package loader
ButterBror.ChatModules.Loader/ChatModuleLoader.cs - Command loader
ButterBror.ChatModules.Loader/CommandModuleLoader.cs - Assembly context
ButterBror.ChatModules.Loader/ModuleAssemblyLoadContext.cs
Chat and commands
- Twitch transport
ButterBror.ChatModules.Twitch/Services/ChatTransports/TwitchChatTransport.cs - Twitch client
ButterBror.ChatModules.Twitch/Services/TwitchClient.cs - Twitch module
ButterBror.ChatModules.Twitch/TwitchModule.cs - Application commands
ButterBror.Application/Commands/UserInfoCommand.cs - Twitch authorization
ButterBror.ChatModules.Twitch/Services/Auth/TwitchAuthPollingService.cs
Core services
- Bot core
ButterBror.Infrastructure/Services/BotCore.cs - Command processing
ButterBror.Infrastructure/Services/CommandDispatcher.cs - Command registry
ButterBror.Infrastructure/Services/CommandRegistry.cs - Dynamic services
ButterBror.Core/DynamicServiceProvider.cs - Localization
ButterBror.Localization/Services/LocalizationService.cs - Locale registry
ButterBror.Localization/Services/LocaleRegistryService.cs - Translation loader
ButterBror.Localization/Services/TranslationFileLoader.cs
Data and dashboard
- Redis service
- Twitch channels
ButterBror.ChatModules.Twitch/Models/TwitchChannelManager.cs - Banphrase repository
ButterBror.Data/Repositories/BanphraseRepository.cs - User repository
ButterBror.Data/Repositories/RedisUserRepository.cs - Dashboard services
ButterBror.Dashboard/Services/MetricsCollector.cs - Dashboard bridge
ButterBror.Dashboard/Services/DashboardBridge.cs
Other components
- Chat user
- Twitch API
- Auth API
Connections 29
- Application host → Bot lifecycle: hosts
ButterBror.Host/Program.cs - Application host → Bot core: registers
ButterBror.Host/Program.cs - Application host → Dynamic services: registers
ButterBror.Host/Program.cs - Application host → User repository: registers
ButterBror.Host/Program.cs - Application host → Dashboard bridge: registers
ButterBror.Host/Program.cs - Bot lifecycle → Bot core: starts
ButterBror.Host/BotHostedService.cs - Bot core → Module manager: initializes
- Module manager → Package loader: loads modules
- Module manager → Command loader: loads commands
ButterBror.Infrastructure/Services/PlatformModuleManager.cs - Package loader → Assembly context: loads assemblies
- Chat user → Twitch transport: sends chat
- Twitch transport → Twitch client: raises messages
ButterBror.ChatModules.Twitch/Services/TwitchClient.cs - Twitch client → Bot core: raises message
- Twitch module → Twitch client: uses
- Bot core → Command processing: processes commands
- Command processing → Command registry: resolves commands
- Module manager → Command registry: registers exports
ButterBror.Infrastructure/Services/PlatformModuleManager.cs - Command processing → Application commands: executes command
- Twitch client → Twitch channels: resolves channels
ButterBror.ChatModules.Twitch/Services/TwitchClient.cs - Twitch channels → Redis service: reads and writes
ButterBror.ChatModules.Twitch/Models/TwitchChannelManager.cs - Banphrase repository → Redis service: reads and writes
ButterBror.Data/Repositories/BanphraseRepository.cs - User repository → Redis service: stores users
- Application host → Localization: registers
- Localization → Locale registry: resolves locales
ButterBror.Localization/Services/LocalizationService.cs - Locale registry → Translation loader: loads registry
ButterBror.Localization/Services/LocaleRegistryService.cs - Twitch authorization → Auth API: polls tokens
ButterBror.ChatModules.Twitch/Services/Auth/TwitchAuthPollingService.cs - Twitch authorization → Twitch client: validates tokens
ButterBror.ChatModules.Twitch/Services/Auth/TwitchAuthPollingService.cs - Twitch client → Twitch API: validates tokens
ButterBror.ChatModules.Twitch/Services/TwitchClient.cs - Dashboard services → Dashboard bridge: publishes metrics