added player names
This commit is contained in:
@@ -14,6 +14,7 @@ type Config struct {
|
||||
OAuthScopes string // Authorisation scopes for OAuth
|
||||
RedirectPath string // ENV DISCORD_REDIRECT_PATH: Path for the OAuth redirect handler (required)
|
||||
BotToken string // ENV DISCORD_BOT_TOKEN: Token for the discord bot (required)
|
||||
GuildID string // ENV DISCORD_GUILD_ID: ID for the discord server the bot should connect to (required)
|
||||
}
|
||||
|
||||
func ConfigFromEnv() (any, error) {
|
||||
@@ -23,6 +24,7 @@ func ConfigFromEnv() (any, error) {
|
||||
OAuthScopes: getOAuthScopes(),
|
||||
RedirectPath: env.String("DISCORD_REDIRECT_PATH", ""),
|
||||
BotToken: env.String("DISCORD_BOT_TOKEN", ""),
|
||||
GuildID: env.String("DISCORD_GUILD_ID", ""),
|
||||
}
|
||||
|
||||
// Check required fields
|
||||
@@ -38,6 +40,9 @@ func ConfigFromEnv() (any, error) {
|
||||
if cfg.BotToken == "" {
|
||||
return nil, errors.New("Envar not set: DISCORD_BOT_TOKEN")
|
||||
}
|
||||
if cfg.GuildID == "" {
|
||||
return nil, errors.New("Envar not set: DISCORD_GUILD_ID")
|
||||
}
|
||||
|
||||
return cfg, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user