Fix custom resolved message not being used for last contact alert
ci/woodpecker/push/woodpecker Pipeline was successful Details

This commit is contained in:
Jan Zípek 2024-04-28 07:23:18 +02:00
parent 0bf63f64a2
commit 40fac3a6f3
Signed by: kamen
GPG Key ID: A17882625B33AC31
1 changed files with 2 additions and 2 deletions

View File

@ -87,8 +87,8 @@ func (s TelegramIntegration) ProcessEvent(evt *ContactPointEvent, rawConfig stri
if data.SensorLastContactCondition != nil { if data.SensorLastContactCondition != nil {
text := fmt.Sprintf("✅ %s has reported in last %s %s", data.Sensor.Name, strconv.FormatFloat(data.SensorLastContactCondition.Value, 'f', -1, 64), data.SensorLastContactCondition.ValueUnit) text := fmt.Sprintf("✅ %s has reported in last %s %s", data.Sensor.Name, strconv.FormatFloat(data.SensorLastContactCondition.Value, 'f', -1, 64), data.SensorLastContactCondition.ValueUnit)
if data.Alert.CustomMessage != "" { if data.Alert.CustomResolvedMessage != "" {
text = data.Alert.CustomMessage text = data.Alert.CustomResolvedMessage
} }
msg := tgbotapi.NewMessage(config.TargetChannel, text) msg := tgbotapi.NewMessage(config.TargetChannel, text)