Skip to content

Releases: soxtoby/SlackNet

v0.7.5

18 Jul 01:02
Compare
Choose a tag to compare
  • Added endpoint configuration method for disabling validation for event URL verification requests.

Thanks again to @fstojanac for this release.

v0.7.4

16 Jul 00:53
5724362
Compare
Choose a tag to compare
  • Fixed a thread-safety issue in SlackTypeConverter that could cause deserialization to fail.

Thanks to @fstojanac for finding and fixing this 🐛🔨

v0.7.3

12 Jul 02:17
Compare
Choose a tag to compare
  • SlackBot uses conversations API internally, as channels/groups/mpim/im APIs have been deprecated by Slack.
  • Added conversation equivalents of channels/groups/mpim/im methods to SlackBot.
  • Default methods' parameters are now optional.
  • Added new Mark method to ConversationsApi.
  • Added cursor-based paging to FilesApi.Info, ReactionsApi.List, and StarsApi.List.

Potentially-Breaking Changes

  • Hub-based methods, properties, and types have been marked as Obsolete. Conversations have the same properties as Channels and Ims, so migrating should be straightforward. The main difference is that rather than having different APIs and methods for channels/groups etc., everything is just a "conversation". If you need to differentiate between the different types of conversations, use the IsChannel, IsGroup etc. properties.
    • SlackBot uses the same API & cache for Conversations, Channels, and Ims, and ConversationIdentifiers are interchangeable with HubIdentifiers, so migrating piecemeal should work OK.
  • The cursor parameter added to FilesApi.Info, ReactionsApi.List, and StarsApi.List was added before the CancellationToken, so on the off chance you were using every single parameter, you'll need to specify the parameter name for the CancellationToken.

v0.7.2

15 Jun 07:02
Compare
Choose a tag to compare
  • Exceptions thrown by handlers bubble up properly.
  • Responder task correctly completed at end of request.

v0.7.1

23 May 01:24
Compare
Choose a tag to compare
  • User and IsUserDeleted added to Conversation.
  • TeamId added to User.
  • Title, RealNameNormalized, DisplayName, Team, and ImageOriginal added to UserProfile.
  • UserProfile.AlwaysActive is now nullable.
  • SelectedDate properties on DatePickerAction and DatePickerValue are now nullable.
  • DateTime properties like DatePicker.InitialDate are properly serialized in the yyyy-MM-dd format that Slack expects.
  • SlackUrlBuilder correctly serializes enumerables of enum values, such as the IEnumerable<ConversationType> parameters in IConversationsApi.

Thank you to @fstojanac and @ivpusic for their help with this release ✨

v0.7.0

16 May 02:16
Compare
Choose a tag to compare
  • Added global shortcut support.
  • Fixed an issue deserializing large requests.
  • More consistent handler registration.
  • Added ability to replace the root handlers.
  • Simplified Azure Functions integration a little.
  • Experimental early-response API.

Breaking Changes

  • MessageAction, IMessageActionHandler, and RegisterMessageActionHandler have been renamed to MessageShortcut, IMessageShortcutHandler, and RegisterMessageShortcutHandler respectively, to match Slack's new terminology. The old types & methods are still available, but have been marked as Obsolete.
  • All the base handler registration classes (e.g. SlackEvents and SlackBlockActions) have been removed. If you were using any of these, I'd recommend just copying their old code - they were pretty simple.
    • If you were relying on the IObservables exposed by SlackEvents, and you're using SlackNet.AspNetCore, you can inject IEventsObservables, which exposes the same observables.
  • RegisterDialogSubmissionHandler now takes in a callbackId, so you can register different handlers for different dialogs. If you want the old behavior where one handler is used for all dialogs, use ReplaceLegacyDialogSubmissionHandling instead. Note that this is for Slack's old dialogs - I'd recommend moving to modal views going forward.
  • SlackResponse has been renamed to SlackResult, and now implements IActionResult.
    • SlackNet.AspNetCore now depends on Microsoft.AspNetCore.Mvc.Abstractions, which you're probably already depending on.
    • If you're using SlackNet.AspNetCore with Azure Functions, I'd recommend copying the updated SlackEndpoints example - it's much simpler now.

Experimental early-response API

A common issue with the current handler API is that SlackNet waits for all of the handlers' work to complete before responding to Slack, which doesn't wait very long before showing errors in the UI. This release includes an experimental API for responding to Slack before completing all the work a handler performs. This lets you implement a handler like this:

public Task Handle(SlashCommand command, Responder<SlashCommandResponse> respond)
{
    // Provides feedback as quickly as possible
    await respond(new SlashCommandResponse { Message = new Message { 
        Text = "Command received" } });

    // Posts more information once it's available
    var info = await FetchSomeInfoFromARemoteService();
    await _slackApi.Chat.PostMessage(new Message { 
        Text = $"Here's what you asked for: {info}" });
}

These new handler types can be registered with the RegisterAsync* methods available inside the configuration callback of AddSlackNet(). Work performed after responding should probably still be kept fairly short, in the order of seconds. If you want to perform longer operations, it's probably best to do it in a background thread.

Please give this a go and provide feedback in the early-response feedback issue.

v0.6.6

05 May 22:43
Compare
Choose a tag to compare
  • ExternalMultiSelectAction correctly inherits from BlockAction.
  • ExternalMultiSelectValue correctly inherits from ElementValue.
  • Added DefaultToCurrentConversation to conversation select menus.
  • Added WithToken() to ISlackApiClient for using a different access token.

Thank you to @mblack-montag for his help with this release 🥇.

v0.6.5

26 Apr 01:19
Compare
Choose a tag to compare
  • Null arguments are ignored for POST requests, same as GET requests. Fixes as_user deprecation error when sending messages with "new" tokens.
  • Added Respond extension method for responding to SlashCommands, similar to the one for responding to InteractionRequests.
  • Fixed deserialization error that occurred after responding with SlashCommand's ResponseUrl.

v0.6.4

19 Apr 00:39
Compare
Choose a tag to compare
  • Adding some missing fields in User type.
  • Fixing UserProfile image property deserialization.
  • Making AsUser properties nullable, since Slack reports them as deprecated in some scenarios.
  • Fixing FilesApi.UploadSnippet.
  • Fixing File.Shares deserialization.
  • Adding View to BlockActionRequest.
  • Adding Respond method to SlackApiClient for using ResponseUrls.
  • MessageResponseWrapper allows message to be null, for responses that delete the source message.
  • Adding new Style property to ConfirmationDialog.
  • Adding new Filter property to ConversationSelectMenu & ConversationMultiSelectMenu.

Thank you to @bschuedzig and @joshuajung for their contributions to this release 👍

v0.6.3

29 Mar 08:53
Compare
Choose a tag to compare
  • Added DateTime.FormatForMessage() extension for localizing DateTimes in messages.
  • Added Files and Upload property to MessageEvent.
  • Fixing URL verification response.
  • Added specific types for ViewInfo element values.
  • Added some missing BlockAction types.