mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add Admin config variables
This commit is contained in:
parent
fab09d68ae
commit
61946d6402
|
@ -26,6 +26,10 @@ func main() {
|
|||
|
||||
nb.TwitchClient.Join("nourybot")
|
||||
|
||||
nb.TwitchClient.OnConnect(func() {
|
||||
nb.TwitchClient.Say("nourybot", "xd")
|
||||
})
|
||||
|
||||
err := nb.TwitchClient.Connect()
|
||||
if err != nil {
|
||||
panic(err)
|
||||
|
|
|
@ -8,10 +8,17 @@ import (
|
|||
)
|
||||
|
||||
type Config struct {
|
||||
// Bot
|
||||
Username string
|
||||
Oauth string
|
||||
BotUserId string
|
||||
MongoURI string
|
||||
Oauth string
|
||||
|
||||
// Admin
|
||||
AdminUsername string
|
||||
AdminUserId string
|
||||
|
||||
// DB
|
||||
MongoURI string
|
||||
}
|
||||
|
||||
func LoadConfig() *Config {
|
||||
|
@ -22,10 +29,17 @@ func LoadConfig() *Config {
|
|||
}
|
||||
|
||||
cfg := &Config{
|
||||
// Bot
|
||||
Username: os.Getenv("BOT_USERNAME"),
|
||||
Oauth: os.Getenv("BOT_PASS"),
|
||||
BotUserId: os.Getenv("BOT_USER_ID"),
|
||||
MongoURI: os.Getenv("MONGO_URI"),
|
||||
|
||||
// Admin
|
||||
AdminUsername: os.Getenv("ADMIN_USER_NAME"),
|
||||
AdminUserId: os.Getenv("ADMIN_USER_ID"),
|
||||
|
||||
// DB
|
||||
MongoURI: os.Getenv("MONGO_URI"),
|
||||
}
|
||||
|
||||
log.Info("Config loaded succesfully")
|
||||
|
|
Loading…
Reference in a new issue