Codebase list golang-github-nlopes-slack / 215bd4e
enable setting profiles for other users than the authenticated one Martin authored 4 years ago James committed 4 years ago
1 changed file(s) with 16 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
484484 // the Slack API will unset the custom status/emoji. If statusExpiration is set to 0
485485 // the status will not expire.
486486 func (api *Client) SetUserCustomStatus(statusText, statusEmoji string, statusExpiration int64) error {
487 return api.SetUserCustomStatusContext(context.Background(), statusText, statusEmoji, statusExpiration)
487 return api.SetUserCustomStatusContextWithUser(context.Background(), "", statusText, statusEmoji, statusExpiration)
488488 }
489489
490490 // SetUserCustomStatusContext will set a custom status and emoji for the currently authenticated user with a custom context
491491 //
492492 // For more information see SetUserCustomStatus
493493 func (api *Client) SetUserCustomStatusContext(ctx context.Context, statusText, statusEmoji string, statusExpiration int64) error {
494 return api.SetUserCustomStatusContextWithUser(context.Background(), "", statusText, statusEmoji, statusExpiration)
495 }
496
497 // SetUserCustomStatusWithUser will set a custom status and emoji for the provided user.
498 //
499 // For more information see SetUserCustomStatus
500 func (api *Client) SetUserCustomStatusWithUser(user, statusText, statusEmoji string, statusExpiration int64) error {
501 return api.SetUserCustomStatusContextWithUser(context.Background(), user, statusText, statusEmoji, statusExpiration)
502 }
503
504 // SetUserCustomStatusContextWithUser will set a custom status and emoji for the provided user with a custom context
505 //
506 // For more information see SetUserCustomStatus
507 func (api *Client) SetUserCustomStatusContextWithUser(ctx context.Context, user, statusText, statusEmoji string, statusExpiration int64) error {
494508 // XXX(theckman): this anonymous struct is for making requests to the Slack
495509 // API for setting and unsetting a User's Custom Status/Emoji. To change
496510 // these values we must provide a JSON document as the profile POST field.
518532 }
519533
520534 values := url.Values{
535 "user": {user},
521536 "token": {api.token},
522537 "profile": {string(profile)},
523538 }