go-mcm/web/alert.go

21 lines
366 B
Go
Raw Normal View History

2019-10-03 20:22:22 +00:00
package web
import (
"net/url"
"git.canopymc.net/Etzelia/go-mcm/internal"
2019-10-03 20:22:22 +00:00
)
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")
}
2019-11-24 21:20:07 +00:00
return internal.ResponseStatus(endpoint, form)
2019-10-03 20:22:22 +00:00
}