Add Telegram Alerting (#102)

This commit is contained in:
Jonah authored and GitHub committed 2021-03-30 19:38:34 -04:00
1 parent 4e5a86031f
commit 24da853820
10 files changed
+212 -9

No files matched your search

+7
View File
@@ -234,6 +234,7 @@ func validateAlertingConfig(config *Config) {
core.MessagebirdAlert,
core.PagerDutyAlert,
core.SlackAlert,
core.TelegramAlert,
core.TwilioAlert,
}
var validProviders, invalidProviders []core.AlertType
@@ -292,6 +293,12 @@ func GetAlertingProviderByAlertType(config *Config, alertType core.AlertType) pr
return nil
}
return config.Alerting.Slack
case core.TelegramAlert:
if config.Alerting.Telegram == nil {
// Since we're returning an interface, we need to explicitly return nil, even if the provider itself is nil
return nil
}
return config.Alerting.Telegram
case core.TwilioAlert:
if config.Alerting.Twilio == nil {
// Since we're returning an interface, we need to explicitly return nil, even if the provider itself is nil