Этот коммит содержится в:
Saturnino Abril
2017-04-27 22:41:52 +09:00
коммит произвёл Joram Wilander
родитель bd66587183
Коммит 0e007e344b
3 изменённых файлов: 162 добавлений и 1 удалений

Просмотреть файл

@@ -2389,6 +2389,17 @@ func (c *Client4) ListCommands(teamId string, customOnly bool) ([]*Command, *Res
}
}
// ExecuteCommand executes a given command.
func (c *Client4) ExecuteCommand(channelId, command string) (*CommandResponse, *Response) {
commandArgs := &CommandArgs{ChannelId: channelId, Command: command}
if r, err := c.DoApiPost(c.GetCommandsRoute()+"/execute", commandArgs.ToJson()); err != nil {
return nil, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return CommandResponseFromJson(r.Body), BuildResponse(r)
}
}
// ListCommands will retrieve a list of commands available in the team.
func (c *Client4) ListAutocompleteCommands(teamId string) ([]*Command, *Response) {
if r, err := c.DoApiGet(c.GetTeamAutoCompleteCommandsRoute(teamId), ""); err != nil {