Added since_id field to ChatsRequest

This commit is contained in:
Pavel 2024-07-16 11:47:23 +03:00 committed by GitHub
commit d01abbc1bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 2 deletions

View File

@ -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 {

View File

@ -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 {