From 305d2124b1fd5dcbeaaed61988ca0aed88ee5d4d Mon Sep 17 00:00:00 2001 From: Anders Fylling Date: Wed, 13 Mar 2019 18:11:55 +0100 Subject: [PATCH] sets Embed fields to be optional --- channel.go | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/channel.go b/channel.go index c92be1ec..239747dc 100644 --- a/channel.go +++ b/channel.go @@ -443,19 +443,19 @@ func (c *Channel) SendMsg(client MessageSender, message *Message) (msg *Message, type ChannelEmbed struct { Lockable `json:"-"` - Title string `json:"title"` // title of embed - Type string `json:"type"` // type of embed (always "rich" for webhook embeds) - Description string `json:"description"` // description of embed - URL string `json:"url"` // url of embed - Timestamp time.Time `json:"timestamp"` // timestamp timestamp of embed content - Color int `json:"color"` // color code of the embed - Footer *ChannelEmbedFooter `json:"footer"` // embed footer object footer information - Image *ChannelEmbedImage `json:"image"` // embed image object image information - Thumbnail *ChannelEmbedThumbnail `json:"thumbnail"` // embed thumbnail object thumbnail information - Video *ChannelEmbedVideo `json:"video"` // embed video object video information - Provider *ChannelEmbedProvider `json:"provider"` // embed provider object provider information - Author *ChannelEmbedAuthor `json:"author"` // embed author object author information - Fields []*ChannelEmbedField `json:"fields"` // array of embed field objects fields information + Title string `json:"title,omitempty"` // title of embed + Type string `json:"type,omitempty"` // type of embed (always "rich" for webhook embeds) + Description string `json:"description,omitempty"` // description of embed + URL string `json:"url,omitempty"` // url of embed + Timestamp time.Time `json:"timestamp,omitempty"` // timestamp timestamp of embed content + Color int `json:"color"` // color code of the embed, black is default + Footer *ChannelEmbedFooter `json:"footer,omitempty"` // embed footer object footer information + Image *ChannelEmbedImage `json:"image,omitempty"` // embed image object image information + Thumbnail *ChannelEmbedThumbnail `json:"thumbnail,omitempty"` // embed thumbnail object thumbnail information + Video *ChannelEmbedVideo `json:"video,omitempty"` // embed video object video information + Provider *ChannelEmbedProvider `json:"provider,omitempty"` // embed provider object provider information + Author *ChannelEmbedAuthor `json:"author,omitempty"` // embed author object author information + Fields []*ChannelEmbedField `json:"fields,omitempty"` // array of embed field objects fields information } // DeepCopy see interface at struct.go#DeepCopier