diff options
| author | Bobby <[email protected]> | 2025-03-27 12:48:49 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2025-03-27 12:48:49 +0530 |
| commit | 1b271061415b33a8f18d1d3d960bc750b9557b69 (patch) | |
| tree | f14bd9b483d849f454f10a9111049e5c191a5154 /config | |
| parent | 3a63a1a8be65f3e50141a3970a9d63d91b191755 (diff) | |
| download | ai-1b271061415b33a8f18d1d3d960bc750b9557b69.tar.xz ai-1b271061415b33a8f18d1d3d960bc750b9557b69.zip | |
command handler and boilerplate play command
Diffstat (limited to 'config')
| -rw-r--r-- | config/config.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/config/config.go b/config/config.go index e3fc5e4..cfc9ef7 100644 --- a/config/config.go +++ b/config/config.go @@ -15,10 +15,9 @@ var Config *types.BotConfig func init() { logPrefix := "Config" logOptions := types.LogOptions{ - Timestamp: true, - Prefix: logPrefix, - Level: types.Error, - Fatal: true, + Prefix: logPrefix, + Level: types.Error, + Fatal: true, } if err := godotenv.Load(); err != nil { @@ -26,6 +25,7 @@ func init() { } Config = &types.BotConfig{ + GuildID: getEnv("GUILD_ID"), DiscordToken: getEnv("DISCORD_TOKEN"), SpotifyClientId: getEnv("SPOTIFY_CLIENT_ID"), SpotifyClientSecret: getEnv("SPOTIFY_CLIENT_SECRET"), @@ -35,6 +35,10 @@ func init() { ActivityURL: getEnv("ACTIVITY_URL"), } + if Config.GuildID == "" { + logger.Log("Unable to read Guild ID. environment variable GUILD_ID is required", logOptions) + } + if Config.DiscordToken == "" { logger.Log("Unable to read Discord token. environment variable DISCORD_TOKEN is required", logOptions) } |
