This commit is contained in:
HugeFrog24
2024-10-20 17:17:21 +02:00
parent e5532df7f9
commit 36717a10d4
6 changed files with 38 additions and 7 deletions

View File

@@ -18,6 +18,7 @@ type BotConfig struct {
TempBanDuration string `json:"temp_ban_duration"`
Model anthropic.Model `json:"model"` // Changed from string to anthropic.Model
SystemPrompts map[string]string `json:"system_prompts"`
Active bool `json:"active"` // New field to control bot activity
}
// Custom unmarshalling to handle anthropic.Model
@@ -56,6 +57,12 @@ func loadAllConfigs(dir string) ([]BotConfig, error) {
return nil, fmt.Errorf("failed to load config %s: %w", configPath, err)
}
// Skip inactive bots
if !config.Active {
fmt.Printf("Skipping inactive bot: %s\n", config.ID)
continue
}
// Validate that ID is present
if config.ID == "" {
return nil, fmt.Errorf("config %s is missing 'id' field", configPath)