mirror of
https://github.com/retailcrm/mg-bot-api-client-go.git
synced 2024-11-24 05:46:04 +03:00
minor patch for constant, update doc
This commit is contained in:
parent
c723bc0e5e
commit
cf98936d96
17
v1/client.go
17
v1/client.go
@ -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)
|
||||||
|
@ -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"
|
||||||
|
Loading…
Reference in New Issue
Block a user