enable setting profiles for other users than the authenticated one
Martin authored 4 years ago
James committed 4 years ago
484 | 484 | // the Slack API will unset the custom status/emoji. If statusExpiration is set to 0 |
485 | 485 | // the status will not expire. |
486 | 486 | 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) | |
488 | 488 | } |
489 | 489 | |
490 | 490 | // SetUserCustomStatusContext will set a custom status and emoji for the currently authenticated user with a custom context |
491 | 491 | // |
492 | 492 | // For more information see SetUserCustomStatus |
493 | 493 | 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 { | |
494 | 508 | // XXX(theckman): this anonymous struct is for making requests to the Slack |
495 | 509 | // API for setting and unsetting a User's Custom Status/Emoji. To change |
496 | 510 | // these values we must provide a JSON document as the profile POST field. |
518 | 532 | } |
519 | 533 | |
520 | 534 | values := url.Values{ |
535 | "user": {user}, | |
521 | 536 | "token": {api.token}, |
522 | 537 | "profile": {string(profile)}, |
523 | 538 | } |