discord failure/success fix

pull/682/head
hunterlong 2020-06-20 12:06:01 -07:00
parent c8e967b476
commit 7344b461d1
1 changed files with 2 additions and 4 deletions

View File

@ -52,15 +52,13 @@ func (d *discord) Select() *notifications.Notification {
// OnFailure will trigger failing service
func (d *discord) OnFailure(s *services.Service, f *failures.Failure) (string, error) {
msg := `{"content": "Your service '{{.Service.Name}}' is currently failing! Reason: {{.Failure.Issue}}"}`
out, err := d.sendRequest(ReplaceVars(msg, s, f))
out, err := d.sendRequest(ReplaceVars(d.FailureData, s, f))
return out, err
}
// OnSuccess will trigger successful service
func (d *discord) OnSuccess(s *services.Service) (string, error) {
msg := `{"content": "Your service '{{.Service.Name}}' is currently online!"}`
out, err := d.sendRequest(ReplaceVars(msg, s, nil))
out, err := d.sendRequest(ReplaceVars(d.SuccessData, s, nil))
return out, err
}