// Sends a message to the discord server/channel using the webhook
Sends a message to the discord server/channel using the webhook
// Sends a message to the discord server / channel using the webhook
func (d *discord) SendDiscordMessage(message string) error {
	discordMessage := DiscordWebHookMessage{
		Message: message,
	}
	jsonBytes, err := httputil.EncodeJson(discordMessage)
	if err != nil {
		return err
	}
	webHookUrl := getDiscordWebHookUrl(d.webHookId, d.webHookToken)
	resp, err := http.Post(webHookUrl, httputil.JsonContentType, bytes.NewBuffer(jsonBytes))
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	return nil
}
func ( d * discord ) SendDiscordMessage ( message string ) error { discordMessage := DiscordWebHookMessage { Message : message , } jsonBytes , err := httputil . EncodeJson ( discordMessage ) if err != nil { return err } webHookUrl := getDiscordWebHookUrl ( d . webHookId , d . webHookToken ) resp , err := http . Post ( webHookUrl , httputil . JsonContentType , bytes . NewBuffer ( jsonBytes ) ) if err != nil { return err } defer resp . Body . Close ( ) return nil }
Sends a message to the discord server/channel using the webhook
Sends a message to the discord server / channel using the webhook