Update vendor (#1257)

This commit is contained in:
Wim
2020-10-11 23:07:00 +02:00
committed by GitHub
parent 219a5453f9
commit 2d98df6122
38 changed files with 5802 additions and 3646 deletions

View File

@@ -509,6 +509,41 @@ func (api *Client) DeleteUserPhotoContext(ctx context.Context) (err error) {
return response.Err()
}
// SetUserRealName changes the currently authenticated user's realName
//
// For more information see SetUserRealNameContextWithUser
func (api *Client) SetUserRealName(realName string) error {
return api.SetUserRealNameContextWithUser(context.Background(), realName, realName)
}
// SetUserRealNameContextWithUser will set a real name for the provided user with a custom context
func (api *Client) SetUserRealNameContextWithUser(ctx context.Context, user, realName string) error {
profile, err := json.Marshal(
&struct {
RealName string `json:"real_name"`
}{
RealName: realName,
},
)
if err != nil {
return err
}
values := url.Values{
"user": {user},
"token": {api.token},
"profile": {string(profile)},
}
response := &userResponseFull{}
if err = api.postMethod(ctx, "users.profile.set", values, response); err != nil {
return err
}
return response.Err()
}
// SetUserCustomStatus will set a custom status and emoji for the currently
// authenticated user. If statusEmoji is "" and statusText is not, the Slack API
// will automatically set it to ":speech_balloon:". Otherwise, if both are ""