oups
This commit is contained in:
@@ -36,15 +36,25 @@ type Panel struct {
|
||||
}
|
||||
|
||||
type Bot struct {
|
||||
AdminRole string `yaml:"admin_role"`
|
||||
LogsChannel string `yaml:"logs_channel"`
|
||||
ClaimChannel string `yaml:"claim_channel"`
|
||||
ConvocationCategory string `yaml:"convocation_category"`
|
||||
ClaimReupMinutes int `yaml:"claim_reup_minutes"`
|
||||
AdminRole string `yaml:"admin_role"`
|
||||
LogsChannel string `yaml:"logs_channel"`
|
||||
ClaimChannel string `yaml:"claim_channel"`
|
||||
ConvocationCategory string `yaml:"convocation_category"`
|
||||
ClaimReupMinutes int `yaml:"claim_reup_minutes"`
|
||||
AllowedGuilds []string `yaml:"allowed_guilds"` // whitelist; empty = use GUILD_ID env only
|
||||
}
|
||||
|
||||
type PanelWebConfig struct {
|
||||
Port int `yaml:"port"`
|
||||
BaseURL string `yaml:"base_url"`
|
||||
OAuthClientID string `yaml:"oauth_client_id"`
|
||||
OAuthClientSecret string `yaml:"oauth_client_secret"`
|
||||
SessionTimeoutMinutes int `yaml:"session_timeout_minutes"`
|
||||
}
|
||||
|
||||
type Config struct {
|
||||
Bot Bot `yaml:"bot"`
|
||||
Panel PanelWebConfig `yaml:"panel"`
|
||||
Panels map[string]Panel `yaml:"panels"`
|
||||
}
|
||||
|
||||
@@ -55,6 +65,12 @@ func (c *Config) Validate() error {
|
||||
if c.Bot.ClaimReupMinutes <= 0 {
|
||||
c.Bot.ClaimReupMinutes = 30
|
||||
}
|
||||
if c.Panel.Port <= 0 {
|
||||
c.Panel.Port = 8080
|
||||
}
|
||||
if c.Panel.SessionTimeoutMinutes <= 0 {
|
||||
c.Panel.SessionTimeoutMinutes = 30
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user