mirror of
https://github.com/HugeFrog24/go-telegram-bot.git
synced 2026-03-02 08:24:34 +00:00
MVP
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user