20 lines
355 B
Go
20 lines
355 B
Go
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)
|
|
}
|