Per-bot API keys implemented

This commit is contained in:
HugeFrog24
2024-10-22 19:29:24 +02:00
parent 298517a79a
commit ebb3ec3fe6
4 changed files with 5 additions and 4 deletions

5
bot.go
View File

@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"log"
"os"
"strings"
"sync"
"time"
@@ -76,8 +75,8 @@ func NewBot(db *gorm.DB, config BotConfig, clock Clock, tgClient TelegramClient)
return nil, err
}
// Initialize Anthropic client
anthropicClient := anthropic.NewClient(os.Getenv("ANTHROPIC_API_KEY"))
// Use the per-bot Anthropic API key
anthropicClient := anthropic.NewClient(config.AnthropicAPIKey)
b := &Bot{
db: db,