init Discord bot

This commit is contained in:
Penguin-71630
2025-12-07 18:40:05 +08:00
parent 0fff1ed54c
commit 067e279a8b
5 changed files with 102 additions and 113 deletions

View File

@@ -8,7 +8,6 @@ import (
type Config struct {
DiscordToken string
APIBaseURL string
BotPrefix string
}
func Load() (*Config, error) {
@@ -22,14 +21,8 @@ func Load() (*Config, error) {
apiURL = "http://localhost:8080" // Default
}
prefix := os.Getenv("BOT_PREFIX")
if prefix == "" {
prefix = "!" // Default prefix
}
return &Config{
DiscordToken: token,
APIBaseURL: apiURL,
BotPrefix: prefix,
}, nil
}