From a639011a066aafb41510f6e1ef110db2240ceb9b Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Sun, 10 Jan 2016 21:39:18 -0800 Subject: [PATCH 1/2] Add attachments fields. --- message.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/message.go b/message.go index 63e7d3e..870c1da 100644 --- a/message.go +++ b/message.go @@ -30,7 +30,14 @@ type Message struct { } // An Attachment stores data for message attachments. -type Attachment struct { //TODO figure this out +type Attachment struct { + Width int `json:"width"` + URL string `json:"url"` + Size int `json:"size"` + ProxyURL string `json:"proxy_url"` + ID string `json:"id"` + Height int `json:"height"` + Filename string `json:"filename"` } // An Embed stores data for message embeds. From 735b01b158b13be822e5ce93a43417d777115446 Mon Sep 17 00:00:00 2001 From: Chris Rhodes Date: Sun, 10 Jan 2016 22:12:45 -0800 Subject: [PATCH 2/2] Embeds. --- message.go | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/message.go b/message.go index 870c1da..59d0297 100644 --- a/message.go +++ b/message.go @@ -31,17 +31,40 @@ type Message struct { // An Attachment stores data for message attachments. type Attachment struct { - Width int `json:"width"` - URL string `json:"url"` - Size int `json:"size"` - ProxyURL string `json:"proxy_url"` ID string `json:"id"` + URL string `json:"url"` + ProxyURL string `json:"proxy_url"` + Width int `json:"width"` Height int `json:"height"` Filename string `json:"filename"` + Size int `json:"size"` } // An Embed stores data for message embeds. -type Embed struct { // TODO figure this out +type Embed struct { + URL string `json:"url"` + Type string `json:"type"` + Title string `json:"title"` + Description string `json:"description"` + Thumbnail *struct { + URL string `json:"url"` + ProxyURL string `json:"proxy_url"` + Width int `json:"width"` + Height int `json:"height"` + } `json:"thumbnail"` + Provider *struct { + URL string `json:"url"` + Name string `json:"name"` + } `json:"provider"` + Author *struct { + URL string `json:"url"` + Name string `json:"name"` + } `json:"author"` + Video *struct { + URL string `json:"url"` + Width int `json:"width"` + Height int `json:"height"` + } `json:"video"` } // ContentWithMentionsReplaced will replace all @ mentions with the