Update db_management/db_management.go
Some checks failed
Bot Unit Tests / test (push) Has been cancelled

This commit is contained in:
2026-04-01 22:01:32 +00:00
parent d37eedf7cf
commit deec858857

View File

@@ -12,7 +12,12 @@ var DB *sql.DB
func InitDB() { func InitDB() {
var err error var err error
// Öffnet bot.db im aktuellen Verzeichnis // Öffnet bot.db im aktuellen Verzeichnis
DB, err = sql.Open("sqlite", "./bot.db") dbPath := os.Getenv("DB_PATH")
if dbPath == "" {
dbPath = "./bot.db"
}
DB, err = sql.Open("sqlite", dbPath)
if err != nil { if err != nil {
panic(err) panic(err)
} }