From bd7b95945511b9ab32638700b49f7f5edbed88c3 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Fri, 13 Jul 2018 15:15:51 +0300 Subject: [PATCH] quotation from transport to mg --- v1/client_test.go | 8 ++++---- v1/types.go | 13 +++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/v1/client_test.go b/v1/client_test.go index 38d366e..7499a50 100644 --- a/v1/client_test.go +++ b/v1/client_test.go @@ -98,7 +98,7 @@ func TestMgClient_Messages(t *testing.T) { t.Logf("%v", ext) snd := SendData{ - SendMessage{ + Message: SendMessage{ Message{ ExternalID: ext, Type: "text", @@ -106,13 +106,13 @@ func TestMgClient_Messages(t *testing.T) { }, time.Now(), }, - User{ + User: User{ ExternalID: "6", Nickname: "octopus", Firstname: "Joe", }, - channelId, - "24798237492374", + Channel: channelId, + ExternalChatID: "24798237492374", } data, status, err := c.Messages(snd) diff --git a/v1/types.go b/v1/types.go index 5da4c7d..3b6c316 100644 --- a/v1/types.go +++ b/v1/types.go @@ -72,10 +72,15 @@ type UpdateMessage struct { // SendData struct type SendData struct { - Message SendMessage `url:"message" json:"message"` - User User `url:"user" json:"user"` - Channel uint64 `url:"channel" json:"channel"` - ExternalChatID string `url:"external_chat_id" json:"external_chat_id"` + Message SendMessage `url:"message" json:"message"` + User User `url:"user" json:"user"` + Channel uint64 `url:"channel" json:"channel"` + ExternalChatID string `url:"external_chat_id" json:"external_chat_id"` + Quote *SendMessageRequestQuote `url:"quote,omitempty" json:"quote,omitempty"` +} + +type SendMessageRequestQuote struct { + ExternalID string `json:"external_id"` } // UpdateData struct