go-mcm/web/alert.go

20 lines
355 B
Go
Raw Normal View History

2019-10-03 20:22:22 +00:00
package web
import (
"go.etztech.xyz/go-mcm/internal"
"net/url"
)
func (web *Web) Alert(message string, ping bool) (*internal.Status, error) {
endpoint := web.endpoint("alert")
form := url.Values{}
form.Add("api", web.Token)
form.Add("message", message)
if ping {
form.Add("ping", "True")
}
return internal.ResponseStatus(endpoint, form)
2019-10-03 20:22:22 +00:00
}