Skip to content

Releases: soxtoby/SlackNet

v0.15.0

12 Oct 01:46
Compare
Choose a tag to compare

Breaking changes

CancellationToken parameters are no longer nullable. They're still optional, so this should only affect code that was explicitly using CancellationToken?.

If you were previously passing in a nullable CancellationToken, I'd recommend null-coalescing to either default or CancellationToken.None.

If you were specifying the type in testing mocks, e.g. with Arg.Any<CancellationToken?>() or It.IsAny<CancellationToken?>(), simply remove the ?. If you were passing in null in tests, replace it with default or CancellationToken.None. If you were asserting that null was passed in as the cancellation token, it should be fine to assert on CancellationToken.None instead.

v0.14.0

25 Sep 03:23
Compare
Choose a tag to compare
  • Socket mode client (and RTM client) retry initial connection unless Slack returns an error response.
  • Improved logging around web socket connections.
  • UseSocketMode properly disconnects the socket mode client when app is shut down.
  • Rate-limited API request retries are cancelled immediately when cancellation is requested.

Breaking changes

  • SlackNet.AspNetCore now depends on Microsoft.Extensions.Hosting.Abstractions.
  • Deprecated Utils.RetryWithDelay - this was never meant to be public.
  • Simplified IWebSocket interface and made Open async.
  • Deprecated SlackEndpointConfiguration.SocketModeConnectionOptions setter - the options should be passed into UseSocketMode instead.

v0.13.3

31 Aug 01:21
Compare
Choose a tag to compare
  • Updating some dependencies to avoid vulnerable packages:
    • SlackNet now depends on System.Net.Security 4.3.1 and System.Text.RegularExpressions 4.3.1.
    • SlackNet.AspNetCore now depends on System.Text.Encodings.Web 4.5.1.
    • SlackNet.AzureFunctions now depends on Microsoft.Azure.Functions.Worker.Core 1.17.0.

v0.13.2

28 Apr 21:28
Compare
Choose a tag to compare
  • Fixed UserProfile deserialization by changing UserProfile.StatusEmojiDisplayInfo to a list.
  • Added Unicode property to EmojiDisplayInfo.

v0.13.1

27 Apr 01:20
Compare
Choose a tag to compare
  • Support for new file upload APIs
    • Added GetUploadUrlExternal and CompleteUploadExternal methods to FilesApi.
    • Added Upload overloads that take advantage of new upload APIs (see below). The old overloads have been marked as obsolete in favour of the new methods.
    • Added IHttp parameter to FilesApi constructor. The old constructor has been marked as obsolete, and will use the default IHttp implementation.
  • Added missing StatusEmojiDisplayInfo, StatusTextCanonical, Pronouns, and StartDate properties to UserProfile.
  • Added ThreadBroadcast event. This replaces ReplyBroadcast, which will now work again, but has been marked as obsolete.

Upload API

Slack's new upload API requires at least 3 requests: 1 to get a URL to upload to, 1 to upload the file to that URL, and 1 to complete the upload operation, and the first 2 of those must be repeated for each file being uploaded together.

SlackNet provides two new Upload methods that handle these requests for you, providing an API similar to the old upload API. These Upload methods take in either a single FileUpload object or an IEnumerable of them, allowing you to specify the file contents in a number of formats, and return references to the uploaded files in Slack. The GetUploadUrlExternal and CompleteUploadExternal methods are provided for completeness, but using Upload is recommended.

v0.13.0

21 Apr 01:47
Compare
Choose a tag to compare
  • Added RichTextList.Offset property.
  • Added RichTextQuote.Border property.
  • Added RichTextPreformatted.Border property.
  • Added Highlight, ClientHighlight, and Unlink properties to RichTextStyle.
  • RichTextStyle properties aren't serialized if they're false.

Breaking changes

  • RichTextList.Elements only accepts RichTextSections.
  • RichTextList.Style changed from a string to RichTextListStyle enum.

v0.12.3

17 Mar 01:42
Compare
Choose a tag to compare
  • Error messages returned from Slack are included in SlackException's message.

v0.12.2

27 Jan 02:22
Compare
Choose a tag to compare
  • Added SlackFile property to Image element and ImageBlock.
  • Added Format property to RichTextDate.
  • Added FileInput block element.

v0.12.1

02 Jan 01:02
Compare
Choose a tag to compare
  • Added experimental option in UseSlackNet to delay responses until after handlers have completed.

v0.12.0

20 Dec 09:46
Compare
Choose a tag to compare
  • ChatApi.PostEphemeral correctly returns PostEphemeralResponse instead of PostMessageResponse.
  • Introduced SlackNet.AzureFunctions package to properly support running in Azure Functions.

Azure Functions

Hosting a SlackNet application in Azure Functions is now properly supported with the new SlackNet.AzureFunctions package. Configuration is similar to previous Azure Functions integration with SlackNet.AspNetCore, but the APIs have been simplified, and the isolated worker model is now supported. Additionally, some issues around the function shutting down before a request has finished being handled have been resolved, albeit at the cost of dropping support for early responses (responses will be sent after you've finished handling the request, no matter how early you respond). See the readme and AzureFunctionsExample project for more information.

Breaking changes

SlackNet.AspNetCore

  • VerifyWith, UseSigningSecret, and UseEventUrlVerification, called inside UseSlackNet, have been marked as obsolete, and will be removed in a future release. These calls should now be made in AddSlackNet instead.
  • The callback in AddSlackNet now takes in an AspNetSlackServiceConfiguration instead of a ServiceCollectionSlackServiceConfiguration. The API is otherwise compatible.
  • Microsoft.AspNetCore.Http and Microsoft.AspNetCore.Http.Abstractions dependencies have been bumped to versions 2.1.22 and 2.1.1 respectively.
  • The methods on ISlackRequestHandler no longer take in a SlackEndpointConfiguration. The configuration is now injected into the implementation.
  • SlackResult no longer implements IActionResult.

Azure Functions

If you're currently using SlackNet.AspNetCore with Azure Functions, you'll need to switch to SlackNet.AzureFunctions, and make the following changes:

  • Make sure you're configuring SlackNet with the AddSlackNet extension from SlackNet.AzureFunctions.
  • Move your SlackEndpointConfiguration configuration into AddSlackNet, and remove its service collection registration.
  • Replace the ISlackRequestHandler and SlackEndpointConfiguration from your endpoints class with just ISlackFunctionRequestHandler, and update its usage to remove the second argument from each method call.
  • Change the return types of your function from Task<SlackResult> to Task<SlackFunctionResult>.

See the AzureFunctionsExample project for an example.

Thankyou to @matthawley for his help with this release 💪