mirror of
https://github.com/retailcrm/mg-bot-api-client-go.git
synced 2024-11-23 13:26:03 +03:00
Added since_id field to ChatsRequest
This commit is contained in:
parent
3d84ddaee6
commit
88eeda804b
@ -309,9 +309,15 @@ func TestMgClient_Chats(t *testing.T) {
|
|||||||
gock.New(mgURL).
|
gock.New(mgURL).
|
||||||
Get("/api/bot/v1/chats").
|
Get("/api/bot/v1/chats").
|
||||||
Reply(200).
|
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)
|
data, status, err := c.Chats(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -154,6 +154,7 @@ type (
|
|||||||
Since string `url:"since,omitempty"`
|
Since string `url:"since,omitempty"`
|
||||||
Until string `url:"until,omitempty"`
|
Until string `url:"until,omitempty"`
|
||||||
Limit int `url:"limit,omitempty"`
|
Limit int `url:"limit,omitempty"`
|
||||||
|
SinceID int `url:"since_id,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
MembersRequest struct {
|
MembersRequest struct {
|
||||||
|
Loading…
Reference in New Issue
Block a user