31 lines
601 B
Go
31 lines
601 B
Go
package conf
|
|
|
|
import (
|
|
"github.com/ilyakaznacheev/cleanenv"
|
|
"github.com/joho/godotenv"
|
|
)
|
|
|
|
type botSettings struct {
|
|
HTTPProxy string `env:"HTTP_PROXY"`
|
|
BotToken string `env:"BOT_TOKEN"`
|
|
MCServer string `env:"MC_SERVER"`
|
|
MCBotName string `env:"MC_BOT_NAME"`
|
|
GroupID int64 `env:"GROUP_ID"`
|
|
DBPath string `env:"DB_PATH"`
|
|
BotAPI string `env:"TG_BOT_API"`
|
|
AdminID []int64 `env:"ADMIN_ID"`
|
|
}
|
|
|
|
var (
|
|
botSettingsInstance botSettings
|
|
)
|
|
|
|
func init() {
|
|
godotenv.Load()
|
|
cleanenv.ReadEnv(&botSettingsInstance)
|
|
}
|
|
|
|
func GetBotSettings() *botSettings {
|
|
return &botSettingsInstance
|
|
}
|