From 89124f62d731a8c0d31f1ec3979c079cccf03d1c Mon Sep 17 00:00:00 2001 From: unintendedfraud Date: Sun, 13 Aug 2023 01:59:40 +0200 Subject: [PATCH] fix env variables names --- env/main.go | 30 +++++++++++++----------------- main.go | 1 + 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/env/main.go b/env/main.go index 8fc06a3..7c5371c 100644 --- a/env/main.go +++ b/env/main.go @@ -8,26 +8,22 @@ import ( ) func GetEnvVariables() Env { - if os.Getenv("RAILWAY_ENVIRONMENT") == "production" { - ids := strings.Split(os.Getenv("SERVER_IDS"), ",") + ids := strings.Split(os.Getenv("DISCORD_SERVER_IDS"), ",") - serverIDs := []tempest.Snowflake{} - for _, id := range ids { - serverIDs = append(serverIDs, tempest.StringToSnowflake(id)) - } - - return Env{ - AppID: tempest.StringToSnowflake(os.Getenv("HAL_APP_ID")), - PublicKey: os.Getenv("HAL_PUBLIC_KEY"), - Token: os.Getenv("HAL_TOKEN"), - Port: os.Getenv("PORT"), - Addr: os.Getenv("ADDR"), - ServerIDs: serverIDs, - OpenaiHalToken: os.Getenv("OPENAI_HAL"), - } + serverIDs := []tempest.Snowflake{} + for _, id := range ids { + serverIDs = append(serverIDs, tempest.StringToSnowflake(id)) } - return Env{} + return Env{ + AppID: tempest.StringToSnowflake(os.Getenv("HAL_APP_ID")), + PublicKey: os.Getenv("HAL_PUBLIC_KEY"), + Token: os.Getenv("HAL_TOKEN"), + Port: os.Getenv("PORT"), + Addr: os.Getenv("ADDR"), + ServerIDs: serverIDs, + OpenaiHalToken: os.Getenv("OPENAI_HAL"), + } } type Env struct { diff --git a/main.go b/main.go index d977ea8..c98e95d 100644 --- a/main.go +++ b/main.go @@ -13,6 +13,7 @@ import ( ) func main() { + fmt.Println("HAL started") env := env.GetEnvVariables() dgclient, err := discordbot.New(env.Token)