Skip to content

v0.12.0

Compare
Choose a tag to compare
@soxtoby soxtoby released this 20 Dec 09:46
· 29 commits to master since this release
  • 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 💪