mirror of https://github.com/statping/statping
discord failure/success fix
parent
c8e967b476
commit
7344b461d1
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue