From cf98936d96b7e7e6f4905bd0e29af29c70280965 Mon Sep 17 00:00:00 2001 From: Alex Lushpai Date: Tue, 18 Sep 2018 17:27:47 +0300 Subject: [PATCH] minor patch for constant, update doc --- v1/client.go | 17 +++++++++++++++++ v1/types.go | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/v1/client.go b/v1/client.go index a130afa..673b136 100644 --- a/v1/client.go +++ b/v1/client.go @@ -300,6 +300,23 @@ func (c *MgClient) Dialogs(request DialogsRequest) ([]DialogResponseItem, int, e return resp, status, err } +// DialogAssign allows to assign dialog to Bot or User +// +// Example: +// +// var client = v1.New("https://demo.url", "09jIJ") +// +// data, status, err := client.DialogAssign(DialogAssignRequest{DialogID: 1, UserID: 6}) +// +// if err != nil { +// fmt.Printf("%v", err) +// } +// +// if status >= http.StatusBadRequest { +// fmt.Printf("%v", err) +// } +// +// fmt.Printf("%v %v\n", data.Responsible, data.LeftUserID ) func (c *MgClient) DialogAssign(request DialogAssignRequest) (DialogAssignResponse, int, error) { var resp DialogAssignResponse outgoing, _ := json.Marshal(&request) diff --git a/v1/types.go b/v1/types.go index 4f8899b..ec9d7a2 100644 --- a/v1/types.go +++ b/v1/types.go @@ -28,7 +28,7 @@ const ( WsEventMessageDeleted string = "message_deleted" WsEventDialogOpened string = "dialog_opened" WsEventDialogClosed string = "dialog_closed" - WsEventDialogAssing string = "dialog_assign" + WsEventDialogAssign string = "dialog_assign" WsEventChatCreated string = "chat_created" WsEventChatUpdated string = "chat_updated" WsEventUserJoined string = "user_joined_chat"