-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.go
32 lines (25 loc) · 827 Bytes
/
config.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package main
import (
"os"
"github.com/fatih/color"
"github.com/joho/godotenv"
)
type Configs map[string]string
func LoadConfigs() Configs {
err := godotenv.Load()
if err != nil {
color.Yellow("Error reading .env.", err)
color.Yellow("Loading environment variables.")
}
config := Configs{
"DISCORD_BOT_TOKEN": os.Getenv("DISCORD_BOT_TOKEN"),
"APP_LANGUAGE": os.Getenv("APP_LANGUAGE"),
"APP_SOUND_PATH": os.Getenv("APP_SOUND_PATH"),
"APP_STOP_IMAGES": os.Getenv("APP_STOP_IMAGES"),
"APP_STOP_AUTHOR_NAME": os.Getenv("APP_STOP_AUTHOR_NAME"),
"APP_STOP_AUTHOR_ICON": os.Getenv("APP_STOP_AUTHOR_ICON"),
"APP_STOP_MSG_TITLE": os.Getenv("APP_STOP_MSG_TITLE"),
"APP_STOP_MSG_DESCRIPTION": os.Getenv("APP_STOP_MSG_DESCRIPTION"),
}
return config
}