NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
NuGet, #2108 most downloaded on NuGet
A comprehensive Slack API client for .NET
Latest stable
0.20.0
Last release 19 days ago
01 Nov 2026
Release timing varies
gaps range from 2 weeks to 5 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
100 releases · first in 2017
Drag across the ruler to compare, or tap a release to open it.
Fixed content type of OAuthV2Api.Access.
OAuthV2Api.Access.AppsEventsAuthorizationsApi.List and renamed API to AppsEventAuthorizations to match endpoint.Added AppUninstalled event content
Thankyou to @Kalissaac for this release 👍
Fixing null ref in Http when making GET requests
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Added SlackRequestContext.Current to provide static access to the current request context. Current throws if not in a request context, so depending on
SlackRequestContext.Current to provide static access to the current request context. Current throws if not in a request context, so depending on where you use it, you'll want to check IsAvailable first.RequestId to SlackRequestContext, which provides a unique ID for the current request.RequestId to RawSocketMessage and SocketMessage.OpenIdApi.Token API.The default logger doesn't do anything, so if you want logging, you'll need to implement the ILogger interface and provide it with one of the UseLogger configuration methods. If you're using SlackNet.AspNetCore, the default logger is overridden with an adaptor for the Microsoft.Extensions.Logging logger, which itself can be overridden as necessary.
Implementing ILogger should be fairly straightforward - see the MicrosoftLoggerAdaptor for an example. I've provided a range of ILogEvent extension methods to adapt log events to a variety of formats. All log events have a Category property, and should have a "Source" message property, which can be used for filtering and determining the appropriate verbosity.
SlackNet.AspNetCore now depends on the Microsoft.Extensions.Logging.Abstractions package.SlackRtmClient requires an ILogger when constructed with specific services.CoreSocketModeClient requires an ILogger when constructed with specific services.SlackSocketModeClient requires an ILogger when constructed.Thankyou to @objmj-itminds for the Open ID improvements ✨
Sign-in with slack support via Open ID api methods
Thankyou to @objmj-itminds for this release 🎁
Implementation of oauth.v2.access method and required response types
Team property to MessageEventThanks to @objmj-itminds for the OAuth API work 🔒
Added ChannelId and UserId properties to the FileShared event.
ChannelId and UserId properties to the FileShared event.Thank you to @objmj-itminds for the addition 🛠
Added optional includeLocale parameter to Info and List in UsersApi, and to Start in RtmApi.
includeLocale parameter to Info and List in UsersApi, and to Start in RtmApi.SlashCommandResponses returned by ISlashCommandHandlers are properly passed on to Slack.While the includeLocale parameters are optional, they haven't been added as the last parameter, so on the off chance you were using all of the optional parameters in one of the modified methods, without specifying parameter names, then you'll need to add some parameter names.
Thankyou to @Selm for helping with this release 👍
Fixed null-ref when using socket mode with ASP.NET integration
This release introduces support for Slack's new socket mode. Socket mode gives you access to all the available Slack functionality without needing to
This release introduces support for Slack's new socket mode. Socket mode gives you access to all the available Slack functionality without needing to host a public endpoint, which makes it ideal for testing a new application, or hosting it inside a local network.
See the SlackNet.SocketModeExample project for example usage. See Using a DI container below for example integration code. With a DI container, handler registration is the same as in SlackNet.EventsExample.
var slackServices = new SlackServiceBuilder();
slackServices
.UseAppLevelToken("<app-level OAuth token required for socket mode>")
.RegisterEventHandler(myEventHandler)
.RegisterBlockActionHandler(myBlockActionHandler);
var client = slackService.GetSocketModeClient();
await client.Connect();
SlackServiceBuilder provides registration methods for all the different types of handlers, as well as the ability to replace specific services with custom implementations, should the need arise.
It also provides methods to retrieve any of the SlackNet services, most notably GetApiClient and GetSocketModeClient.
Similar to the RTM client, once connected, the socket mode client will reconnect automatically, until the client is disposed, or socket mode is disabled.
Each message received is treated as a "request", equivalent to receiving a request through the ASP.NET integration. Responses are returned as acknowledgements through the websocket connection.
By default, the socket mode client will open 2 connections, 10 seconds apart, so messages can still be received while one of the connections is being reconnected. You can configure this behaviour by passing a SocketModeConnectionOptions object into the client's Connect method.
The built-in SlackServiceBuilder requires services and handlers to be constructed manually, but with a DI container, they can be registered with just a type, leaving construction to the container. Other services registered in the container can be injected as you'd expect, and services and handlers are given appropriate lifestyles.
Since the configuration has been standardised, it's pretty much the same for any container, but here's what it looks like for the provided integrations…
Using the SlackNet.Autofac package:
var containerBuilder = new ContainerBuilder();
containerBuilder.AddSlackNet(c => c
.UseAppLevelToken("<app-level OAuth token>")
.RegisterEventHandler<MyEventHandler>()
.RegisterBlockActionHandler<MyBlockActionHandler>());
var container = containerBuilder.Build();
var client = container.Resolve<ISlackSocketModeClient>();
await client.Connect();
Using the SlackNet.Extensions.DependencyInjection package:
var serviceCollection = new ServiceCollection();
serviceCollection.AddSlackNet(c => c
.UseAppLevelToken("<app-level OAuth token>")
.RegisterEventHandler<MyEventHandler>()
.RegisterBlockActionHandler<MyBlockActionHandler>());
var serviceProvider = serviceCollection.BuildServiceProvider();
var client = serviceProvider.GetRequiredService<ISlackSocketModeClient>();
await client.Connect();
Using the SlackNet.SimpleInjector package:
var container = new Container {
// AsyncScopedLifestyle is used for scoping handlers
Options = { DefaultScopedLifestyle = new AsyncScopedLifestyle() }
};
container.AddSlackNet(c => c
.UseAppLevelToken("<app-level OAuth token>")
.RegisterEventHandler<MyEventHandler>()
.RegisterBlockActionHandler<MyBlockActionHandler>());
var client = container.GetInstance<ISlackSocketModeClient>();
await client.Connect();
Microsoft.Bcl.AsyncInterfaces package.Default.Http takes in a Func<HttpClient> instead of just a HttpClient, to allow a client to be provided per request.Default.RegisterServices has been removed.Microsoft.AspNetCore.Http and SlackNet.Extensions.DependencyInjection packages.Microsoft.Extensions.DependencyInjection.Abstractions dependency to 2.2.0.SlackServiceConfiguration has been replaced with ServiceCollectionSlackServiceConfiguration as the configuration object passed to the AddSlackNet configuration callback.IEventsObservables has been removed. It's simple enough to re-implement if anyone needs it, but it doesn't fit the rest of the API.Fixed empty ViewState.Values deserialization, which occurs when a modal dialog is closed without entering any values.
ViewState.Values deserialization, which occurs when a modal dialog is closed without entering any values.Description property to block kit Options for use with radio buttons.Added Files and Blocks to SlackBot's messages.
Files and Blocks to SlackBot's messages.Thanks to @eFloh for this release ✨
A few changes relating to Slack deprecating some of their old API features...
A few changes relating to Slack deprecating some of their old API features...
EventCallback.AuthedUsers has been removed.Added Ephemeral property to BotMessage, to allow sending ephemeral replies.
Ephemeral property to BotMessage, to allow sending ephemeral replies.Obsolete. These APIs will stop functioning in February 2021.Thanks to @fstojanac for doing most of the heavy lifting in this release 💪
Added EventContext and Authorizations to EventCallback. AuthedUsers is now obsolete.
EventContext and Authorizations to EventCallback. AuthedUsers is now obsolete.AppsEventsAuthorizations API to SlackApiClient.AppMention event.Thanks to @fstojanac and @Julian-Robinson for this release 🎉
Added support for PlainTextInputs dispatching actions when someone interacts with them.
PlainTextInputs dispatching actions when someone interacts with them.TimePicker block element (note: still a beta feature at time of writing).Thanks to @fstojanac for his help with this release 🙇♂️
Fixed SlackBot fetching conversations other than public channels.
SlackBot fetching conversations other than public channels.Thank you to @Silvenga for this fix 🐱🏍
Fixed infinite loop when fetching conversations in SlackBot.
SlackBot.ApiAppId to SlashCommand.Fixing InvalidOperationException caused by re-using request when rate limits hit.
InvalidOperationException caused by re-using request when rate limits hit.Requests will automatically retry after a delay when rate limits are hit and Slack responds with a 429 HTTP response.
Thanks to @fstojanac for his help with this release 🥳
Added endpoint configuration method for disabling validation for event URL verification requests.
Thanks again to @fstojanac for this release.
Fixed a thread-safety issue in SlackTypeConverter that could cause deserialization to fail.
Thanks to @fstojanac for finding and fixing this 🐛🔨
SlackBot uses conversations API internally, as channels/groups/mpim/im APIs have been deprecated by Slack.
SlackBot uses conversations API internally, as channels/groups/mpim/im APIs have been deprecated by Slack.SlackBot.Default methods' parameters are now optional.Mark method to ConversationsApi.FilesApi.Info, ReactionsApi.List, and StarsApi.List.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.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.Exceptions thrown by handlers bubble up properly.
User and IsUserDeleted added to Conversation.
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 ✨
Fixed an issue deserializing large requests.
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.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.
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.
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.
ExternalMultiSelectAction correctly inherits from BlockAction.
ExternalMultiSelectAction correctly inherits from BlockAction.ExternalMultiSelectValue correctly inherits from ElementValue.DefaultToCurrentConversation to conversation select menus.WithToken() to ISlackApiClient for using a different access token.Thank you to @mblack-montag for his help with this release 🥇.
Null arguments are ignored for POST requests, same as GET requests. Fixes as_user deprecation error when sending messages with "new" tokens.
as_user deprecation error when sending messages with "new" tokens.Respond extension method for responding to SlashCommands, similar to the one for responding to InteractionRequests.SlashCommand's ResponseUrl.Making AsUser properties nullable, since Slack reports them as deprecated in some scenarios.
User type.UserProfile image property deserialization.AsUser properties nullable, since Slack reports them as deprecated in some scenarios.FilesApi.UploadSnippet.File.Shares deserialization.View to BlockActionRequest.Respond method to SlackApiClient for using ResponseUrls.MessageResponseWrapper allows message to be null, for responses that delete the source message.Style property to ConfirmationDialog.Filter property to ConversationSelectMenu & ConversationMultiSelectMenu.Thank you to @bschuedzig and @joshuajung for their contributions to this release 👍
Added DateTime.FormatForMessage() extension for localizing DateTimes in messages.
DateTime.FormatForMessage() extension for localizing DateTimes in messages.Files and Upload property to MessageEvent.ViewInfo element values.BlockAction types.Forcing TLS 1.2 for websocket connections
Forcing TLS 1.2 for websocket connections
Removed deprecated MessageEvent.Replies property.
System.Reactive v4.SlackNet and SlackNet.Bot now require .NET Standard 2.0.SlackEventsMiddleware is no longer available.EventCallback and UrlVerification now inherit from EventRequest instead of Event.MessageEvent.Replies property.Thank you to @casperOne for contributing to this release 🎉.
Removed deprecated pins and reactions methods dealing with files and file comments.
PostMessage and GetPermalink methods to IChatApi.SlackNet.AspNetCore.OAuthApi.Access's redirect_uri request argument.SlackBot can now be cancelled (if the message hasn't already been sent).SlackBot are now exposed to user code instead of being swallowed.SlackBot have their User property populated correctly.SlackBot.GetBotUserById.RemoteFilesApi.ChannelShared and ChannelUnshared events.RichTextBlock.Thank you 🙏 to @eFloh, @mrmurb, @taskbit, and @Silvenga for their help with this release.
Switching to POST requests for API methods that Slack prefers POST for, allowing for larger requests with more content.
ISlackApiClient exposes two new Post methods that POST their args in the body of the request.IHttp interface now provides a single Execute method that takes in a HttpRequestMessage, rather than separate Get and Post methods.Fixing deserialization of UserProfiles where the user has modified their profile, but hasn't filled in any _custom_ fields.
Fixing deserialization of UserProfiles where the user has modified their profile, but hasn't filled in any custom fields.
Full support for message blocks.
SlackNet.AspNetCore allows registering handlers for block actions and providing options to external_select block elements.SlackNet.AspNetCore to allow more flexibility.DateTime properties, which were always null.RegisterDialogSubmissionHandler correctly registers the handler without requiring an extra manual registration.Attachment.Ts is now nullable to allow sending attachments with blocks.IMessageActionHandler.Handle no longer returns a MessageActionResponse, which didn't work anyway. MessageActionResponse has been removed.InteractionRequest.CallbackId property pushed down to old sub-types, since the new BlockActionRequest doesn't have it.DialogElement.Type is now a string, to allow extension if necessary. The DialogElementType enum has been removed.Added support for message actions.
SlackRtmClient to subscribe to and query for user presence events.ConversationsApi.Open.SlackBot correctly sets Hub on incoming IMs.ConversationsApi.Open takes in a channelId or userIds, and only returns a channel ID.ConversationsApi.Open no longer takes in returnIm. Use ConversationsApi.OpenAndReturnInfo instead.UsersApi.List's presence parameter, as it is no longer supported.UsersApi.SetActive method, as it is no longer supported.FileShare messages contain a Files list instead of a single File.FileCommentsApi's Add and Edit methods, as they are no longer supported.IDialogSubmissionHandler must now implement HandleCancel. Just return Task.CompletedTask if you don't care about cancelled dialogs.DndApi.TeamInfo's userIds parameter is now required.MessageAction support, there are a few "Action"-related renames:
ISlackActions to ISlackInteractiveMessages.IActionHandler to IInteractiveMessageHandler.SlackServiceConfiguration.RegisterActionHandler to RegisterInteractiveMessageHandler.Nothing published for this version
Added AspNetCore project with endpoints for events and interactive messages
RTM client has better reconnection logic and doesn't drop events after an error
One column per quarter.