From 88eeda804bf7cdb5030b72d61b6103e0984df48f Mon Sep 17 00:00:00 2001 From: Vlasov Date: Tue, 16 Jul 2024 11:40:08 +0300 Subject: [PATCH] Added since_id field to ChatsRequest --- v1/client_test.go | 10 ++++++++-- v1/types.go | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/v1/client_test.go b/v1/client_test.go index 5965543..fbddc55 100644 --- a/v1/client_test.go +++ b/v1/client_test.go @@ -309,9 +309,15 @@ func TestMgClient_Chats(t *testing.T) { gock.New(mgURL). Get("/api/bot/v1/chats"). Reply(200). - BodyString(`[{"id": 1,"customer": {"id": 1, "name": "Test"}, "created_at": "2018-01-01T00:00:00.000000Z"}]`) + BodyString(`[ + {"id": 2,"customer": {"id": 2, "name": "Foo"}, "created_at": "2018-01-01T00:00:00.000000Z"}, + {"id": 3,"customer": {"id": 3, "name": "Bar"}, "created_at": "2018-01-02T00:00:00.000000Z"} + ]`) - req := ChatsRequest{ChannelType: ChannelTypeTelegram} + req := ChatsRequest{ + ChannelType: ChannelTypeTelegram, + SinceID: 1, + } data, status, err := c.Chats(req) if err != nil { diff --git a/v1/types.go b/v1/types.go index 2376efc..2d43e5f 100644 --- a/v1/types.go +++ b/v1/types.go @@ -154,6 +154,7 @@ type ( Since string `url:"since,omitempty"` Until string `url:"until,omitempty"` Limit int `url:"limit,omitempty"` + SinceID int `url:"since_id,omitempty"` } MembersRequest struct {