Use sensible defaults.
This commit is contained in:
parent
3a0c1f87d4
commit
80ab4b4476
1 changed files with 26 additions and 1 deletions
|
|
@ -127,7 +127,32 @@ func (c *Settings) Marshal() ([]byte, error) {
|
|||
}
|
||||
|
||||
func LoadSettings(name string, fs vfs.VFS) (*Settings, error) {
|
||||
conf := &Settings{}
|
||||
conf := &Settings{
|
||||
API: &API{},
|
||||
Chat: &Chat{
|
||||
Channels: make([]int64, 0),
|
||||
},
|
||||
DailyScripture: &DailyScripture{
|
||||
UserSubmitted: false,
|
||||
Schedule: "0 8 * * *",
|
||||
},
|
||||
System: &System{
|
||||
TimeZone: "UTC",
|
||||
DSN: "",
|
||||
Logging: &Logging{
|
||||
Level: "info",
|
||||
},
|
||||
},
|
||||
Service: &Service{
|
||||
BotToken: "",
|
||||
Method: "polling",
|
||||
Webhook: &Webhook{
|
||||
URI: "",
|
||||
Port: 0,
|
||||
Host: "localhost",
|
||||
},
|
||||
},
|
||||
}
|
||||
file, err := fs.Open(name)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
|
|
|||
Loading…
Reference in a new issue