mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
27 lines
448 B
Go
27 lines
448 B
Go
package config
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
type Config struct {
|
|
TwitchUsername string
|
|
TwitchOauth string
|
|
Environment string
|
|
}
|
|
|
|
func New() *Config {
|
|
err := godotenv.Load()
|
|
if err != nil {
|
|
log.Fatal("Error loading .env file")
|
|
}
|
|
twitchUsername := os.Getenv("TWITCH_USERNAME")
|
|
twitchOauth := os.Getenv("TWITCH_OAUTH")
|
|
environment := "Development"
|
|
|
|
return &Config{twitchUsername, twitchOauth, environment}
|
|
}
|