diff --git a/config/config.go b/config/config.go index 7f3602e0..35cd06dd 100644 --- a/config/config.go +++ b/config/config.go @@ -516,8 +516,8 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error { if discord.HTTPConfig == nil { discord.HTTPConfig = c.Global.HTTPConfig } - if discord.WebhookURL == nil { - return fmt.Errorf("no discord webhook URL provided") + if discord.WebhookURL == nil && len(discord.WebhookURLFile) == 0 { + return fmt.Errorf("no discord webhook URL or URLFile provided") } } for _, webex := range rcv.WebexConfigs { @@ -536,8 +536,8 @@ func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error { if msteams.HTTPConfig == nil { msteams.HTTPConfig = c.Global.HTTPConfig } - if msteams.WebhookURL == nil { - return fmt.Errorf("no msteams webhook URL provided") + if msteams.WebhookURL == nil && len(msteams.WebhookURLFile) == 0 { + return fmt.Errorf("no msteams webhook URL or URLFile provided") } }