Add bot command settings.

This commit is contained in:
Benjamin A. Shelton 2026-10-16 00:14:24 -06:00
commit 7ccf2b2073
Signed by: zancarius
GPG key ID: 8BD42DBD6C337E01
2 changed files with 29 additions and 5 deletions

View file

@ -22,6 +22,7 @@ type Settings struct {
System *System `toml:"system"`
Service *Service `toml:"service"`
Chat *Chat `toml:"chat"`
Debug *Debug `toml:"debug"`
}
// Reload previously loaded configuration.
@ -69,13 +70,19 @@ type DailyScripture struct {
}
type System struct {
TimeZone string `toml:"timezone"`
DSN string `toml:"dsn"`
TimeZone string `toml:"timezone"`
DSN string `toml:"dsn"`
Logging *Logging `toml:"logging"`
}
type Logging struct {
Level string `toml:"level"`
}
type Service struct {
Method string `toml:"method"`
Webhook *Webhook `toml:"webhook"`
BotToken string `toml:"secret"`
Method string `toml:"method"`
Webhook *Webhook `toml:"webhook"`
}
type Webhook struct {
@ -94,6 +101,15 @@ type Translations struct {
Active []string `toml:"active"`
}
type Debug struct {
Commands struct {
// Resets the command list by deleting all existing commands.
Reset bool `toml:"reset"`
// Clears the bot's commands and doesn't re-add them.
Clear bool `toml:"clear"`
} `toml:"commands"`
}
func (c *Settings) Marshal() ([]byte, error) {
buf := &bytes.Buffer{}