Update dependencies / vendor (#1146)

This commit is contained in:
Wim
2020-05-24 00:06:21 +02:00
committed by GitHub
parent ba0bfe70a8
commit 393f9e998b
438 changed files with 35015 additions and 92744 deletions

View File

@@ -5,6 +5,7 @@ import (
"encoding/json"
"net/url"
"strconv"
"strings"
"time"
)
@@ -184,6 +185,7 @@ type TeamIdentity struct {
type userResponseFull struct {
Members []User `json:"members,omitempty"`
User `json:"user,omitempty"`
Users []User `json:"users,omitempty"`
UserPresence
SlackResponse
Metadata ResponseMetadata `json:"response_metadata"`
@@ -252,6 +254,26 @@ func (api *Client) GetUserInfoContext(ctx context.Context, user string) (*User,
return &response.User, nil
}
// GetUsersInfo will retrieve the complete multi-users information
func (api *Client) GetUsersInfo(users ...string) (*[]User, error) {
return api.GetUsersInfoContext(context.Background(), users...)
}
// GetUsersInfoContext will retrieve the complete multi-users information with a custom context
func (api *Client) GetUsersInfoContext(ctx context.Context, users ...string) (*[]User, error) {
values := url.Values{
"token": {api.token},
"users": {strings.Join(users, ",")},
"include_locale": {strconv.FormatBool(true)},
}
response, err := api.userRequest(ctx, "users.info", values)
if err != nil {
return nil, err
}
return &response.Users, nil
}
// GetUsersOption options for the GetUsers method call.
type GetUsersOption func(*UserPagination)