Releases: soxtoby/SlackNet
v0.11.3
- Added optional
teamIdparameter toIConversationsApi.Create. - Added support for message metadata.
- Added
MessageMetadataPosted,MessageMetadataUpdated, andMessageMetadataDeletedevents. - Added
BotId,AppId, andBotProfileproperties toMessageEvent. - Added
TeamId,Deleted, andUpdatedproperties toBotInfo. - Added
RichTextInputand fixed posting messages withRichTextBlocks.
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
CancellationTokentoIConversationsApi.Createas a positional argument, you'll need to either addnullas theteamIdargument, or specify thecancellationTokenparameter name. - Added a
SlackJsonSettingsparameter to theChatApiconstructor. If you're constructingChatApimanually, you can pass inDefault.JsonSettings(), or your own customized settings. - Pushed the
InitialValueproperty ofTextInputdown to its sub-classes, to account forRichTextInput's different type of value.
Thankyou to @jtsai-osa for his help with this release π
v0.11.2
v0.11.1
- Added missing
IsExtSharedChannelproperty toEventCallback. - Incoming requests are logged when using
SlackNet.AspNetCore. - Default ASP.NET logger logs with the specific SlackNet category (e.g.
SlackNet.Errorinstead of justSlackNet).
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
- Added the
UserHuddleChanged,UserProfileChanged, andUserStatusChangedevents. - Added logging for serialization. Useful for debugging serialization issues, but otherwise I'd recommend filtering out
LogEvents in theSerializationcategory. - Added
Attachmentsproperty toMessageSearchResult. - Added
Unsafeproperty toRichTextLink. - Added
ThumbWidth,ThumbHeight,OriginalUrl,ServiceName, andServiceIconproperties toAttachment.
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
v0.10.23
v0.10.22
v0.10.21
- 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
- Added
Link.Emailhelper method for creating email links. - Added
PostToWebhookmethod toSlackApiClientfor posting messages to incoming webhooks. - Added
IncomingWebhookproperty toOauthV2AccessResponsefor collecting generated webhook URLs.
Thankyou to @TimSon777 for his help with this release π
v0.10.19
- Fixed deserialization of
MessageBlocksproperty in attachments. DatePicker.FocusOnLoadproperty isn't serialized when false, to avoid a Slack internal error.- Added
DateTimePicker,EmailTextInput,UrlTextInput, andNumberInputblock elements.
Thanks again to @theteladras for his help with this release π€