Skip to content

Releases: soxtoby/SlackNet

v0.11.3

07 Oct 02:18

Choose a tag to compare

  • Added optional teamId parameter to IConversationsApi.Create.
  • Added support for message metadata.
  • Added MessageMetadataPosted, MessageMetadataUpdated, and MessageMetadataDeleted events.
  • Added BotId, AppId, and BotProfile properties to MessageEvent.
  • Added TeamId, Deleted, and Updated properties to BotInfo.
  • Added RichTextInput and fixed posting messages with RichTextBlocks.

Metadata

When posting a message to Slack, you can specify the metadata in one of two ways:

await slack.Chat.PostMessage(new Message
    {
        Channel = "#general",
        Text = "My message",

        // Use your own metadata object. It will be serialized with the standard Slack conventions,
        // and the event_type will be the name of the class in snake case.
        MetadataObject = new MyMetadata("my info"),

        // Specify the metadata JSON explicitly. This will take precedence over MetadataObject.
        MetadataJson = new MessageMetadata
            {
                EventType = "my_metadata",
                EventPayload = JToken.Parse("""{ "custom_info": "my info" }""") // Get your JToken from wherever you like  
            }
    });

Messages retrieved from Slack will have a Metadata property that contains the event type and JSON as a JToken. To deserialize the JSON using the standard Slack JSON conventions, use the ToObject method on MessageMetadata, not the ToObject method on JToken:

var myMetadata = message.Metadata.ToObject<MyMetadata>();

Potentially breaking changes

  • If you were passing a CancellationToken to IConversationsApi.Create as a positional argument, you'll need to either add null as the teamId argument, or specify the cancellationToken parameter name.
  • Added a SlackJsonSettings parameter to the ChatApi constructor. If you're constructing ChatApi manually, you can pass in Default.JsonSettings(), or your own customized settings.
  • Pushed the InitialValue property of TextInput down to its sub-classes, to account for RichTextInput's different type of value.

Thankyou to @jtsai-osa for his help with this release πŸ‘

v0.11.2

18 Aug 15:26

Choose a tag to compare

  • Renamed SnoozeEndTime on SnoozeResponse and OwnDndResponse so it deserializes properly.
  • Added SnoozeIsIndefinite to SnoozeResponse and OwnDndResponse.

v0.11.1

10 Aug 19:29

Choose a tag to compare

  • Added missing IsExtSharedChannel property to EventCallback.
  • Incoming requests are logged when using SlackNet.AspNetCore.
  • Default ASP.NET logger logs with the specific SlackNet category (e.g. SlackNet.Error instead of just SlackNet).

When using the default logger with ASP.NET, individual SlackNet log categories can be enabled in appsettings.json with:

"Logging": {
  "LogLevel": {
    "SlackNet.Data": "Trace",
    "SlackNet.Serialization": "Trace",
    "SlackNet.Internal": "Debug",
    "SlackNet.Request": "Information",
    "SlackNet.Error": "Error"
  }
}

Setting a category to a higher level will filter out logs from that category.

v0.11.0

23 Jul 00:10

Choose a tag to compare

  • Added the UserHuddleChanged, UserProfileChanged, and UserStatusChanged events.
  • Added logging for serialization. Useful for debugging serialization issues, but otherwise I'd recommend filtering out LogEvents in the Serialization category.
  • Added Attachments property to MessageSearchResult.
  • Added Unsafe property to RichTextLink.
  • Added ThumbWidth, ThumbHeight, OriginalUrl, ServiceName, and ServiceIcon properties to Attachment.

Breaking Changes

  • Removed the stars API and associated classes. See this Slack announcement for more details.

Thankyou to @fstojanac for his help with this release πŸ’ͺ

v0.10.24

02 Jul 00:13
a88e3b7

Choose a tag to compare

  • Added cursor-based pagination to TeamApi.AccessLogs and FilesApi.List.
  • ChatApi.PostEphemeral can post to threads.

Thankyou to @arkolka for their help with this release πŸŽ‰

v0.10.23

28 May 00:44

Choose a tag to compare

  • Added FileIds to MessageUpdate to allow removing and re-adding files when updating a message.
  • SlackApiClient.WithAccessToken() maintains the value of DisableRetryOnRateLimit.

v0.10.22

26 Feb 01:43

Choose a tag to compare

  • Added HuddleState and HuddleStateExpirationTs properties to UserProfile.

Thankyou to @JoeMyers for this release βž•

v0.10.21

11 Feb 01:37

Choose a tag to compare

  • Fixed content type of event endpoint challenge.
  • Checking content type of request before trying to deserialize it.

Thankyou to @SamuelCharest for his help with this release πŸ› οΈ

v0.10.20

04 Feb 00:40

Choose a tag to compare

  • Added Link.Email helper method for creating email links.
  • Added PostToWebhook method to SlackApiClient for posting messages to incoming webhooks.
  • Added IncomingWebhook property to OauthV2AccessResponse for collecting generated webhook URLs.

Thankyou to @TimSon777 for his help with this release πŸ‘

v0.10.19

15 Jan 03:12

Choose a tag to compare

  • Fixed deserialization of MessageBlocks property in attachments.
  • DatePicker.FocusOnLoad property isn't serialized when false, to avoid a Slack internal error.
  • Added DateTimePicker, EmailTextInput, UrlTextInput, and NumberInput block elements.

Thanks again to @theteladras for his help with this release 🀝