Releases: soxtoby/SlackNet
v0.7.5
- Added endpoint configuration method for disabling validation for event URL verification requests.
Thanks again to @fstojanac for this release.
v0.7.4
- Fixed a thread-safety issue in SlackTypeConverter that could cause deserialization to fail.
Thanks to @fstojanac for finding and fixing this 🐛🔨
v0.7.3
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 toConversationsApi
. - Added cursor-based paging to
FilesApi.Info
,ReactionsApi.List
, andStarsApi.List
.
Potentially-Breaking Changes
- Hub-based methods, properties, and types have been marked as
Obsolete
.Conversation
s have the same properties asChannel
s andIm
s, 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 theIsChannel
,IsGroup
etc. properties.SlackBot
uses the same API & cache forConversation
s,Channel
s, andIm
s, andConversationIdentifier
s are interchangeable withHubIdentifiers
, so migrating piecemeal should work OK.
- The
cursor
parameter added toFilesApi.Info
,ReactionsApi.List
, andStarsApi.List
was added before theCancellationToken
, so on the off chance you were using every single parameter, you'll need to specify the parameter name for theCancellationToken
.
v0.7.2
v0.7.1
User
andIsUserDeleted
added toConversation
.TeamId
added toUser
.Title
,RealNameNormalized
,DisplayName
,Team
, andImageOriginal
added toUserProfile
.UserProfile.AlwaysActive
is now nullable.SelectedDate
properties onDatePickerAction
andDatePickerValue
are now nullable.DateTime
properties likeDatePicker.InitialDate
are properly serialized in theyyyy-MM-dd
format that Slack expects.SlackUrlBuilder
correctly serializes enumerables of enum values, such as theIEnumerable<ConversationType>
parameters inIConversationsApi
.
Thank you to @fstojanac and @ivpusic for their help with this release ✨
v0.7.0
- 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
, andRegisterMessageActionHandler
have been renamed toMessageShortcut
,IMessageShortcutHandler
, andRegisterMessageShortcutHandler
respectively, to match Slack's new terminology. The old types & methods are still available, but have been marked asObsolete
.- All the base handler registration classes (e.g.
SlackEvents
andSlackBlockActions
) 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
IObservable
s exposed bySlackEvents
, and you're using SlackNet.AspNetCore, you can injectIEventsObservables
, which exposes the same observables.
- If you were relying on the
RegisterDialogSubmissionHandler
now takes in acallbackId
, so you can register different handlers for different dialogs. If you want the old behavior where one handler is used for all dialogs, useReplaceLegacyDialogSubmissionHandling
instead. Note that this is for Slack's old dialogs - I'd recommend moving to modal views going forward.SlackResponse
has been renamed toSlackResult
, and now implementsIActionResult
.- 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
ExternalMultiSelectAction
correctly inherits fromBlockAction
.ExternalMultiSelectValue
correctly inherits fromElementValue
.- Added
DefaultToCurrentConversation
to conversation select menus. - Added
WithToken()
toISlackApiClient
for using a different access token.
Thank you to @mblack-montag for his help with this release 🥇.
v0.6.5
- 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 toSlashCommand
s, similar to the one for responding toInteractionRequest
s. - Fixed deserialization error that occurred after responding with
SlashCommand
'sResponseUrl
.
v0.6.4
- 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
toBlockActionRequest
. - Adding
Respond
method toSlackApiClient
for usingResponseUrl
s. MessageResponseWrapper
allows message to be null, for responses that delete the source message.- Adding new
Style
property toConfirmationDialog
. - Adding new
Filter
property toConversationSelectMenu
&ConversationMultiSelectMenu
.
Thank you to @bschuedzig and @joshuajung for their contributions to this release 👍