minor patch for constant, update doc

This commit is contained in:
Alex Lushpai 2018-09-18 17:27:47 +03:00
parent c723bc0e5e
commit cf98936d96
2 changed files with 18 additions and 1 deletions

View File

@ -300,6 +300,23 @@ func (c *MgClient) Dialogs(request DialogsRequest) ([]DialogResponseItem, int, e
return resp, status, err 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) { func (c *MgClient) DialogAssign(request DialogAssignRequest) (DialogAssignResponse, int, error) {
var resp DialogAssignResponse var resp DialogAssignResponse
outgoing, _ := json.Marshal(&request) outgoing, _ := json.Marshal(&request)

View File

@ -28,7 +28,7 @@ const (
WsEventMessageDeleted string = "message_deleted" WsEventMessageDeleted string = "message_deleted"
WsEventDialogOpened string = "dialog_opened" WsEventDialogOpened string = "dialog_opened"
WsEventDialogClosed string = "dialog_closed" WsEventDialogClosed string = "dialog_closed"
WsEventDialogAssing string = "dialog_assign" WsEventDialogAssign string = "dialog_assign"
WsEventChatCreated string = "chat_created" WsEventChatCreated string = "chat_created"
WsEventChatUpdated string = "chat_updated" WsEventChatUpdated string = "chat_updated"
WsEventUserJoined string = "user_joined_chat" WsEventUserJoined string = "user_joined_chat"