discord-selphybot/config.go

39 lines
784 B
Go
Raw Normal View History

2018-06-03 10:40:28 +02:00
package main
import (
2019-01-10 00:16:39 +01:00
"encoding/json"
"os"
2018-06-03 10:40:28 +02:00
)
type Embed struct {
2019-01-10 00:16:39 +01:00
Message string
QuestionsTitle string
QuestionsText string
BugsTitle string
BugsText string
Image string
2018-06-03 10:40:28 +02:00
}
type Config struct {
2019-01-10 00:16:39 +01:00
Admins []string
ServerID string
LockedRoleID string
Token string
WelcomeChannel string
GeneralChannel string
SendWelcomeDM bool
RequireAccept bool
ComplaintReceivedMessage string
ModChannel string
WelcomeEmbed Embed
RoleCommands map[string]string
2018-06-03 10:40:28 +02:00
}
func readConfig() Config {
2019-01-10 00:16:39 +01:00
file, _ := os.Open("config.json")
conf := Config{}
json.NewDecoder(file).Decode(&conf)
file.Close()
return conf
2018-06-03 10:40:28 +02:00
}