Thanks again to Michal (@akfaew) for another round of fixes in this release.
Breaking changes — read before upgrading
Warning
v0.36.0 includes breaking API, decoding, and serialization changes.
Your code may fail to compile. Code that still compiles may decode or serialize
differently. Events API URL-verification responses now use a different JSON key.
Review every item below before upgrading, including RTM and Events API handlers,
tests that build or compare event payloads, and code that decodes into reused values.
1. RTM group_rename event types have changed
slack.GroupRenameEventgainsEventTimestamp. Positional struct literals no
longer compile. Use keyed literals, such as
slack.GroupRenameEvent{Type: "group_rename", Group: info, Timestamp: ts}.
Timestampkeeps itstsJSON key; the newevent_tskey is omitted when empty.slack.GroupRenameInfo.Createdis nowint64. ReplaceCreated: "1360782804"
withCreated: 1360782804. Parse input strings withstrconv.ParseInt(value, 10, 64),
and usestrconv.FormatInt(info.Created, 10)where a string is still needed.
Marshaling now emits a JSON number, and decoding rejects quoted timestamps.
2. URL-verification responses use a lowercase challenge key
slackevents.ChallengeResponse now marshals as {"challenge":"..."} instead of
{"Challenge":"..."}, matching Slack's documented response. Assignments from
untagged anonymous structs no longer compile; use
slackevents.ChallengeResponse{Challenge: value} instead.
3. slackevents.CallRejectedEvent is flattened
- Read fields directly from the event. Replace
event.Event.CallIDwith
event.CallID, and likewise forType,UserID,ChannelID, andExternalUniqueID. - Envelope fields are removed.
Token,TeamID,APIAppID,EventID, and
AuthedUsersare gone. Decode full callback payloads withslackevents.ParseEvent
and read envelope metadata from the returnedEventsAPIEventand its
*EventsAPICallbackEventdata. Typeis nowcall_rejected, not the outerevent_callback. Marshaling
produces the inner event object instead of the complete callback envelope.
4. Decoding into reused values replaces previous contents
ActionCallbacks,ContextElements, andBlockObjectsreplace previous entries
instead of appending. Decoding[A, B]followed by[C]now leaves[C];[]and
JSONnullclear all entries. The legacy{"elements":null}wrapper remains a no-op
forContextElements. To accumulate entries, decode separately and append the slices.AccessoryandSlackResponseErrorsreplace all previous variants on a
successful decode, instead of retaining fields from earlier decodes. JSONnull
clears accessory variants; it remains a no-op forSlackResponseErrorsand for the
legacy{"accessory":null}wrapper.
A failed decode may clear or partially replace the destination. Do not use it
after a decoding error. To keep the previous value, decode into a separate value and
assign it only after success.
Added
- Add
AdminUsersSetAdmin,AdminUsersSetOwner, andAdminUsersSetRegular, with
Contextvariants, to change a user's account type on a workspace or Enterprise org.
With an org ID,admin.users.setRegularalso removes the user's Workspace Owner
roles (Slack changelog).
The existingSetRegularstill calls the legacyusers.admin.setRegularendpoint. - Add
AdminUsersGetExpirationandAdminUsersSetExpiration, withContext
variants, to read and set when a guest account is disabled.
AdminUsersGetExpirationOptionTargetTeamandAdminUsersSetExpirationOptionTeamID
select a workspace in the org. Slack API reference:
admin.users.getExpiration,
admin.users.setExpiration. - Add
AdminUsersAssign,AdminUsersInvite, andAdminUsersRemove, withContext
variants and options for guest access, channels, and invite details, to manage
workspace membership in an Enterprise org.InviteToTeam,InviteGuest, and
InviteRestrictedstill call the legacyusers.admin.inviteendpoint. - Add
AdminUsersSessionList,AdminUsersSessionReset,AdminUsersSessionResetBulk,
AdminUsersSessionGetSettings,AdminUsersSessionSetSettings, and
AdminUsersSessionClearSettings, withContextvariants, to list and reset
member sessions and manage their session settings. - Add
AdminUsersUnsupportedVersionsExportand itsContextvariant to have
Slackbot send a CSV of members on unsupported Slack clients. - Add
AdminUsersAccessPauseandAdminUsersAccessResume, withContextvariants
and areasonoption, to queue pausing or resuming org-wide access for frontline
members. Onfailed_for_some_users, the returned response lists the rejected
users inInvalidUsers; Slack still queues the others.
Fixed
- Expose
event_tsin RTMgroup_renameevents asEventTimestamp, preserving
Timestampfor the separatetsfield. - Decode numeric creation timestamps in RTM
group_renameevents
instead of dispatchingunmarshalling_error. - Use the lowercase
challengeJSON key in Events API URL-verification responses. - Preserve call and user identifiers when parsing
call_rejectedEvents API events. - Replace previous actions, context elements, and composition objects when decoding into reused values.
- Replace stale accessory and API error variants when decoding into reused values.
- Stop the Socket Mode handler's event dispatcher when its client returns an error,
preserving queued events before returning.
Full Changelog: v0.35.0...v0.36.0