discord-flauschbot/config.go

22 lines
298 B
Go
Raw Permalink Normal View History

2018-06-03 10:40:28 +02:00
package main
import (
"os"
"encoding/json"
)
type Config struct {
Admins []string
2018-06-03 10:40:28 +02:00
ServerID string
Token string
}
func readConfig() Config {
2018-06-06 17:29:49 +02:00
file, _ := os.Open("config.json")
2018-06-03 10:40:28 +02:00
conf := Config{}
json.NewDecoder(file).Decode(&conf)
file.Close()
return conf
}