Files
velox-bot/internal/config/config.go
T
FernandoJVideira d7edfea45e feat: integrate music commands with Lavalink support
- Added new music commands: play, queue, and volume.
- Implemented music management using disgolink for Lavalink integration.
- Updated bot initialization to include Lavalink host and password.
- Enhanced interaction handling for music commands, requiring DJ role for usage.
- Introduced now playing message with interactive buttons for controlling playback.
- Updated dependencies in go.mod for disgolink and snowflake.
2026-03-18 03:47:42 +00:00

56 lines
1011 B
Go

package config
import (
"fmt"
"os"
"github.com/joho/godotenv"
)
type Config struct {
BotToken string
AppID string
GuildID string
DBHost string
LavalinkHost string
LavalinkPass string
}
func LoadConfig() (*Config, error) {
if err := godotenv.Load(); err != nil {
return nil, err
}
token := os.Getenv("BOT_TOKEN")
if token == "" {
return nil, fmt.Errorf("BOT_TOKEN is not set")
}
appID := os.Getenv("APP_ID")
if appID == "" {
return nil, fmt.Errorf("APP_ID is not set")
}
guildID := os.Getenv("GUILD_ID")
if guildID == "" {
return nil, fmt.Errorf("GUILD_ID is not set")
}
dbHost := os.Getenv("DB_HOST")
if dbHost == "" {
return nil, fmt.Errorf("DB_HOST is not set")
}
lavalinkHost := os.Getenv("LAVALINK_HOST")
lavalinkPass := os.Getenv("LAVALINK_PASSWORD")
return &Config{
BotToken: token,
AppID: appID,
GuildID: guildID,
DBHost: dbHost,
LavalinkHost: lavalinkHost,
LavalinkPass: lavalinkPass,
}, nil
}