diff options
author | Wim <wim@42.be> | 2020-05-24 00:06:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-05-24 00:06:21 +0200 |
commit | 393f9e998b1b40aa59d3fb8794c3a73da38c3fb7 (patch) | |
tree | 2bc9b6e6abdbdc6d811b155997597bdae62bc7db /vendor/github.com/slack-go/slack/users.go | |
parent | ba0bfe70a8f07164e1341f4b094841acdad5c3a2 (diff) | |
download | matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.tar.gz matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.tar.bz2 matterbridge-msglm-393f9e998b1b40aa59d3fb8794c3a73da38c3fb7.zip |
Update dependencies / vendor (#1146)
Diffstat (limited to 'vendor/github.com/slack-go/slack/users.go')
-rw-r--r-- | vendor/github.com/slack-go/slack/users.go | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/vendor/github.com/slack-go/slack/users.go b/vendor/github.com/slack-go/slack/users.go index 6001e0fa..364958e8 100644 --- a/vendor/github.com/slack-go/slack/users.go +++ b/vendor/github.com/slack-go/slack/users.go @@ -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) |