From af2ee6ce0b3f1f85729b11ac836671293d977fa7 Mon Sep 17 00:00:00 2001 From: Pranas Kiziela Date: Fri, 9 Nov 2018 17:40:45 +0200 Subject: [PATCH] Add location attachment support --- receiving.go | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/receiving.go b/receiving.go index 96185a2..4bcac1f 100644 --- a/receiving.go +++ b/receiving.go @@ -92,7 +92,7 @@ type Recipient struct { // Attachment is a file which used in a message. type Attachment struct { - // Type is what type the message is. (image, video or audio) + // Type is what type the message is. (image, video, audio or location) Type string `json:"type"` // Payload is the information for the file which was sent in the attachment. Payload Payload `json:"payload"` @@ -111,5 +111,15 @@ type QuickReply struct { // Payload is the information on where an attachment is. type Payload struct { // URL is where the attachment resides on the internet. - URL string `json:"url,omitempty"` + URL string `json:"url,omitempty"` + // Coordinates is Lat/Long pair of location pin + Coordinates *Coordinates `json:"coordinates,omitempty"` +} + +// Coordinates is a pair of latitude and longitude +type Coordinates struct { + // Lat is latitude + Lat float64 `json:"lat"` + // Long is longitude + Long float64 `json:"long"` }