func CreateChannelMessage(client httd.Poster, channelID Snowflake, params *CreateChannelMessageParams) (ret *Message, err error) {
	if channelID.Empty() {
		err = errors.New("channelID must be set to get channel messages")
		return
	}
	if params == nil {
		err = errors.New("message must be set")
		return
	}

	_, body, err := client.Post(&httd.Request{
		Ratelimiter: ratelimitChannelMessages(channelID),
		Endpoint:    "/channels/" + channelID.String() + "/messages",
		JSONParams:  params,
		ContentType: httd.ContentTypeJSON,
	})
	if err != nil {
		return
	}

	err = unmarshal(body, &ret)
	return
}
// CreateChannelMessage [POST] Post a message to a guild text or DM channel. If operating on a guild channel,
//                             this endpoint requires the 'SEND_MESSAGES' permission to be present on the
//                             current user. If the tts field is set to true, the SEND_TTS_MESSAGES permission
//                             is required for the message to be spoken. Returns a message object. Fires a
//                             Message Create Gateway event. See message formatting for more information on
//                             how to properly format messages.
//                             The maximum request size when sending a message is 8MB.
// Endpoint                    /channels/{channel.id}/messages
// Rate limiter [MAJOR]        /channels/{channel.id}/messages
// Discord documentation       https://discordapp.com/developers/docs/resources/channel#create-message
// Reviewed                    2018-06-10
// Comment                     Before using this endpoint, you must connect to and identify with a gateway
//                             at least once. This endpoint supports both JSON and form data bodies. It does
//                             require multipart/form-data requests instead of the normal JSON request type
//                             when uploading files. Make sure you set your Content-Type to multipart/form-data
//                             if you're doing that. Note that in that case, the embed field cannot be used,
//                             but you can pass an url-encoded JSON body as a form value for payload_json.
CreateChannelMessage [POST] Post a message to a guild text or DM channel. If operating on a guild channel,
this endpoint requires the 'SEND_MESSAGES' permission to be present on the
current user. If the tts field is set to true, the SEND_TTS_MESSAGES permission
is required for the message to be spoken. Returns a message object. Fires a
Message Create Gateway event. See message formatting for more information on
how to properly format messages.
The maximum request size when sending a message is 8MB.
// CreateChannelMessage [ POST ] Post a message to a guild text or DM channel . If operating on a guild channel // this endpoint requires the ' SEND_MESSAGES ' permission to be present on the // current user . If the tts field is set to true the SEND_TTS_MESSAGES permission // is required for the message to be spoken . Returns a message object . Fires a // Message Create Gateway event . See message formatting for more information on // how to properly format messages . // The maximum request size when sending a message is 8MB . // Endpoint / channels / { channel . id } / messages // Rate limiter [ MAJOR ] / channels / { channel . id } / messages // Discord documentation https : // discordapp . com / developers / docs / resources / channel#create - message // Reviewed 2018 - 06 - 10 // Comment Before using this endpoint you must connect to and identify with a gateway // at least once . This endpoint supports both JSON and form data bodies . It does // require multipart / form - data requests instead of the normal JSON request type // when uploading files . Make sure you set your Content - Type to multipart / form - data // if you ' re doing that . Note that in that case the embed field cannot be used // but you can pass an url - encoded JSON body as a form value for payload_json .
func CreateChannelMessage(client httd.Poster, channelID Snowflake, params *CreateChannelMessageParams) (ret *Message, err error) {
	if channelID.Empty() {
		err = errors.New("channelID must be set to get channel messages")
		return
	}
	if params == nil {
		err = errors.New("message must be set")
		return
	}
	_, body, err := client.Post(&httd.Request{
		Ratelimiter: ratelimitChannelMessages(channelID),
		Endpoint:    "/channels/" + channelID.String() + "/messages",
		JSONParams:  params,
		ContentType: httd.ContentTypeJSON,
	})
	if err != nil {
		return
	}
	err = unmarshal(body, &ret)
	return
}
func CreateChannelMessage ( client httd . Poster , channelID Snowflake , params * CreateChannelMessageParams ) ( ret * Message , err error ) { if channelID . Empty ( ) { err = errors . New ( " " ) return } if params == nil { err = errors . New ( " " ) return } _ , body , err := client . Post ( & httd . Request { Ratelimiter : ratelimitChannelMessages ( channelID ) , Endpoint : " " + channelID . String ( ) + " " , JSONParams : params , ContentType : httd . ContentTypeJSON , } ) if err != nil { return } err = unmarshal ( body , & ret ) return }
CreateChannelMessage [POST] Post a message to a guild text or DM channel.
CreateChannelMessage [ POST ] Post a message to a guild text or DM channel .