go-mcm/web/discord.go

21 lines
370 B
Go

package web
import (
"net/url"
"git.canopymc.net/Etzelia/go-mcm/internal"
)
func (web *Web) Discord(message string, ping bool) (*internal.Status, error) {
endpoint := web.endpoint("discord")
form := url.Values{}
form.Add("api", web.Token)
form.Add("message", message)
if ping {
form.Add("ping", "True")
}
return internal.ResponseStatus(endpoint, form)
}