Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-04-03 14:12:50 +02:00
коммит произвёл Joram Wilander
родитель 67a8770118
Коммит 88b8df3146
5 изменённых файлов: 168 добавлений и 2 удалений

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

@@ -2019,6 +2019,17 @@ func (c *Client4) CreateCommand(cmd *Command) (*Command, *Response) {
}
}
// ListCommands will retrieve a list of commands available in the team.
func (c *Client4) ListCommands(teamId string, customOnly bool) ([]*Command, *Response) {
query := fmt.Sprintf("?team_id=%v&custom_only=%v", teamId, customOnly)
if r, err := c.DoApiGet(c.GetCommandsRoute()+query, ""); err != nil {
return nil, &Response{StatusCode: r.StatusCode, Error: err}
} else {
defer closeBody(r)
return CommandListFromJson(r.Body), BuildResponse(r)
}
}
// Status Section
// GetUserStatus returns a user based on the provided user id string.