Warning
This release contains multiple breaking changes. Please review the sections below before upgrading.
Breaking changes
Removed APIs
IMstruct removed — UseConversationinstead.IsUserDeletedhas been moved there.Info.GetBotByID,GetUserByID,GetChannelByID,GetGroupByID,GetIMByIDremoved — These were deprecated and returnednilunconditionally. Remove any calls to them.
Signature changes
-
ListReactionsnow uses cursor-based pagination — Returns([]ReactedItem, string, error)instead of([]ReactedItem, *Paging, error).ListReactionsParametersreplacesCount/PagewithCursor/Limit.// Before items, paging, err := api.ListReactions(params) // After items, nextCursor, err := api.ListReactions(params)
-
ListStars/GetStarrednow use cursor-based pagination — Same pattern: returnsstring(next cursor) instead of*Paging.StarsParametersreplacesCount/PagewithCursor/Limit. -
GetAccessLogsnow uses cursor-based pagination — Same pattern: returnsstring(next cursor) instead of*Paging.AccessLogParametersreplacesCount/PagewithCursor/Limit. -
Ack()andSend()now returnerror(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→*bool—nilmeans absent/unknown (bot tokens),falsemeans explicitly disabled.
Behavior changes
MsgOptionBlocks()with no arguments now sendsblocks=[]— Previously a silent no-op. If you relied on that, remove the option entirely.adminerror 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 viaopenid.connect.userInfo([#967])OAuthOptionAPIURLfor 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.) viaOptionOnResponseHeaderscallback ([#1076]) - API warning callbacks — Register
OptionWarnings(func(warnings []string))to receive Slack deprecation notices ([#1540]) DNDOptionTeamID— Passteam_idtoGetDNDInfo/GetDNDTeamInfo, required after workspace migration ([#1157])UpdateUserGroupMembersList— Accepts[]stringinstead of comma-separated string ([#1172])SetUserProfile— Set multiple profile fields in a single API call ([#1158])- RTM events —
user_status_changed,user_huddle_changed,user_profile_changed,sh_room_join,sh_room_leave,sh_room_update,channel_updated([#1541], [#858]) - Socket Mode handlers —
HandleShortcut,HandleViewSubmission,HandleViewClosedfor Level 3 dispatch byCallbackID([#1161]) - New fields —
UsernameonUser([#1218]),Blocks/Attachments/Files/UploadonAppMentionEvent([#961]),BlocksonMessageEvent([#1257]),IsConnectorBot/IsWorkflowBotonUser,GuestInvitedByonUserProfile,CacheTS/EventTSonUserChangeEvent
Fixed
UnknownBlockround-trip data loss — Unrecognized block types now preserve their full JSON through unmarshal/marshal cyclesWorkflowButtonBlockElementmissing fromUnmarshalJSON— Plus missingmulti_*_selectandfile_inputcases ([#1539])NewBlockHeadernil pointer dereference — Passing a nil text object no longer panics ([#1236])ValidateUniqueBlockIDfalse positives — Emptyblock_idstrings 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 parseblock_actions. Useslack.InteractionCallbackwithjson.Unmarshalinstead ([#596])slackevents.MessageAction,MessageActionEntity,MessageActionResponse— Legacyinteractive_messagetypes only
Full Changelog: v0.20.0...v0.21.0