diff --git a/internal/settings/settings.go b/internal/settings/settings.go index 57ef5da..3af66fa 100644 --- a/internal/settings/settings.go +++ b/internal/settings/settings.go @@ -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 { diff --git a/settings.sample.toml b/settings.sample.toml index 1b4add8..047c481 100644 --- a/settings.sample.toml +++ b/settings.sample.toml @@ -15,6 +15,11 @@ active = [ ] default = "bsb" +[scheduler] + [scheduler.announcements] + weekly = "Sunday" + daily = "30 7 * * *" + [system] timezone = "America/Denver" dsn = "sqlite3:///data/biblebot.sqlite3?_journal_mode=WAL&_foreign_keys=true"