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