github slack-go/slack v0.21.0

5 hours ago

Warning

This release contains multiple breaking changes. Please review the sections below before upgrading.

Breaking changes

Removed APIs

  • IM struct removed — Use Conversation instead. IsUserDeleted has been moved there.
  • Info.GetBotByID, GetUserByID, GetChannelByID, GetGroupByID, GetIMByID removed — These were deprecated and returned nil unconditionally. Remove any calls to them.

Signature changes

  • ListReactions now uses cursor-based pagination — Returns ([]ReactedItem, string, error) instead of ([]ReactedItem, *Paging, error). ListReactionsParameters replaces Count/Page with Cursor/Limit.

    // Before
    items, paging, err := api.ListReactions(params)
    // After
    items, nextCursor, err := api.ListReactions(params)
  • ListStars/GetStarred now use cursor-based pagination — Same pattern: returns string (next cursor) instead of *Paging. StarsParameters replaces Count/Page with Cursor/Limit.

  • GetAccessLogs now uses cursor-based pagination — Same pattern: returns string (next cursor) instead of *Paging. AccessLogParameters replaces Count/Page with Cursor/Limit.

  • Ack() and Send() now return error (Socket Mode) — Large payloads (≥20KB) that Slack silently dropped are now rejected with an error. Existing call sites that ignore the return value still compile.

Type changes

  • WebhookMessage.UnfurlLinks / UnfurlMedia*bool — Required to distinguish "omit" from "false".

    // Before
    msg := slack.WebhookMessage{UnfurlLinks: true}
    // After
    t := true
    msg := slack.WebhookMessage{UnfurlLinks: &t}
  • User.Has2FA*boolnil means absent/unknown (bot tokens), false means explicitly disabled.

Behavior changes

  • MsgOptionBlocks() with no arguments now sends blocks=[] — Previously a silent no-op. If you relied on that, remove the option entirely.
  • admin error strings now start with lowercase — If you match error content in your code, update your comparisons.

Added

  • admin.teams.settings.* API support — Full suite: AdminTeamsSettingsInfo, SetDefaultChannels, SetDescription, SetDiscoverability, SetIcon, SetName ([#960])
  • BlockFromJSON / MustBlockFromJSON — Create blocks from raw JSON strings, enabling direct use of output from Slack's Block Kit Builder ([#1497])
  • GetOpenIDConnectUserInfo — Returns identity info via openid.connect.userInfo ([#967])
  • OAuthOptionAPIURL for package-level OAuth functions — Override the Slack API URL for testing ([#744])
  • HTTP response headers — Access Slack response headers (X-OAuth-Scopes, X-Ratelimit-*, etc.) via OptionOnResponseHeaders callback ([#1076])
  • API warning callbacks — Register OptionWarnings(func(warnings []string)) to receive Slack deprecation notices ([#1540])
  • DNDOptionTeamID — Pass team_id to GetDNDInfo/GetDNDTeamInfo, required after workspace migration ([#1157])
  • UpdateUserGroupMembersList — Accepts []string instead of comma-separated string ([#1172])
  • SetUserProfile — Set multiple profile fields in a single API call ([#1158])
  • RTM eventsuser_status_changed, user_huddle_changed, user_profile_changed, sh_room_join, sh_room_leave, sh_room_update, channel_updated ([#1541], [#858])
  • Socket Mode handlersHandleShortcut, HandleViewSubmission, HandleViewClosed for Level 3 dispatch by CallbackID ([#1161])
  • New fieldsUsername on User ([#1218]), Blocks/Attachments/Files/Upload on AppMentionEvent ([#961]), Blocks on MessageEvent ([#1257]), IsConnectorBot/IsWorkflowBot on User, GuestInvitedBy on UserProfile, CacheTS/EventTS on UserChangeEvent

Fixed

  • UnknownBlock round-trip data loss — Unrecognized block types now preserve their full JSON through unmarshal/marshal cycles
  • WorkflowButtonBlockElement missing from UnmarshalJSON — Plus missing multi_*_select and file_input cases ([#1539])
  • NewBlockHeader nil pointer dereference — Passing a nil text object no longer panics ([#1236])
  • ValidateUniqueBlockID false positives — Empty block_id strings no longer flagged as duplicates ([#1184])
  • Socket Mode: large Ack payloads silently failing — Now uses 32KB write buffer and rejects payloads ≥20KB with an error ([#1196])

Deprecated

  • slackevents.ParseActionEvent — Cannot parse block_actions. Use slack.InteractionCallback with json.Unmarshal instead ([#596])
  • slackevents.MessageAction, MessageActionEntity, MessageActionResponse — Legacy interactive_message types only

Full Changelog: v0.20.0...v0.21.0

Don't miss a new slack release

NewReleases is sending notifications on new releases.