Cleanup, add scheduler.
This will eventually be rolled up into the announcements subsystem.
This commit is contained in:
parent
ff6aba11c6
commit
0c132657ff
2 changed files with 31 additions and 0 deletions
|
|
@ -19,6 +19,7 @@ type Settings struct {
|
|||
API *API `toml:"api"`
|
||||
DailyScripture *DailyScripture `toml:"daily_scripture"`
|
||||
Translations *Translations `toml:"translations"`
|
||||
Scheduler *Scheduler `toml:"scheduler"`
|
||||
System *System `toml:"system"`
|
||||
Service *Service `toml:"service"`
|
||||
Chat *Chat `toml:"chat"`
|
||||
|
|
@ -79,6 +80,13 @@ type Logging struct {
|
|||
Level string `toml:"level"`
|
||||
}
|
||||
|
||||
type Scheduler struct {
|
||||
Announcements struct {
|
||||
Weekly string `toml:"weekly"`
|
||||
Daily string `toml:"daily"`
|
||||
} `toml:"announcements"`
|
||||
}
|
||||
|
||||
type Service struct {
|
||||
BotToken string `toml:"secret"`
|
||||
Method string `toml:"method"`
|
||||
|
|
@ -144,6 +152,15 @@ func LoadSettings(name string, fs vfs.VFS) (*Settings, error) {
|
|||
Level: "info",
|
||||
},
|
||||
},
|
||||
Scheduler: &Scheduler{
|
||||
Announcements: struct {
|
||||
Weekly string `toml:"weekly"`
|
||||
Daily string `toml:"daily"`
|
||||
}{
|
||||
Weekly: "Sunday",
|
||||
Daily: "30 7 * * *",
|
||||
},
|
||||
},
|
||||
Service: &Service{
|
||||
BotToken: "",
|
||||
Method: "polling",
|
||||
|
|
@ -159,6 +176,15 @@ func LoadSettings(name string, fs vfs.VFS) (*Settings, error) {
|
|||
Active: []string{"bsb", "kjv"},
|
||||
Default: "bsb",
|
||||
},
|
||||
Debug: &Debug{
|
||||
Commands: struct {
|
||||
Register bool `toml:"register"`
|
||||
Reset bool `toml:"reset"`
|
||||
}{
|
||||
Register: true,
|
||||
Reset: false,
|
||||
},
|
||||
},
|
||||
}
|
||||
file, err := fs.Open(name)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Reference in a new issue