Skip to content

Commit d67d355

Browse files
committed
Change MessageReference to pointer in CreateMessageJSON
The type of `MessageReference` field in `CreateMessageJSON` struct has been changed from `MessageReference` to `*MessageReference`. This modification ensures proper handling of null reference cases and improves overall pointer-based operations.
1 parent 60ba5d8 commit d67d355

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

api/channel_endpoints.go

+10-10
Original file line numberDiff line numberDiff line change
@@ -296,16 +296,16 @@ func (c *Channel) CreateMessage(payload CreateMessageJSON) (*Message, error) {
296296
// CreateMessageJSON - JSON payload structure
297297
// TODO: files[n]
298298
type CreateMessageJSON struct {
299-
Content string `json:"content,omitempty"` // the message contents (up to 2000 characters)
300-
TTS bool `json:"tts,omitempty"` // true if this is a TTS message
301-
Embeds []*Embed `json:"embeds,omitempty"` // embedded rich content (up to 6000 characters)
302-
AllowedMentions AllowedMentions `json:"allowed_mentions,omitempty"` // allowed mentions for the message
303-
MessageReference MessageReference `json:"message_reference,omitempty"` // include to make your message a reply
304-
Components []*Component `json:"components,omitempty"` // the components to include with the message
305-
StickerIDs []*Snowflake `json:"sticker_ids,omitempty"` // IDs of up to 3 stickers in the server to send in the message
306-
PayloadJson string `json:"payload_json,omitempty"` // JSON encoded body of non-file params
307-
Attachments []*Attachment `json:"attachments,omitempty"` // attachment objects with filename and description
308-
Flags MessageFlags `json:"flags,omitempty"` // message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set)
299+
Content string `json:"content,omitempty"` // the message contents (up to 2000 characters)
300+
TTS bool `json:"tts,omitempty"` // true if this is a TTS message
301+
Embeds []*Embed `json:"embeds,omitempty"` // embedded rich content (up to 6000 characters)
302+
AllowedMentions AllowedMentions `json:"allowed_mentions,omitempty"` // allowed mentions for the message
303+
MessageReference *MessageReference `json:"message_reference,omitempty"` // include to make your message a reply
304+
Components []*Component `json:"components,omitempty"` // the components to include with the message
305+
StickerIDs []*Snowflake `json:"sticker_ids,omitempty"` // IDs of up to 3 stickers in the server to send in the message
306+
PayloadJson string `json:"payload_json,omitempty"` // JSON encoded body of non-file params
307+
Attachments []*Attachment `json:"attachments,omitempty"` // attachment objects with filename and description
308+
Flags MessageFlags `json:"flags,omitempty"` // message flags combined as a bitfield (only SUPPRESS_EMBEDS can be set)
309309
}
310310

311311
// CrosspostMessage - Crosspost a message in an GuildAnnouncement Channel to following channels.

0 commit comments

Comments
 (0)