Releases: slackapi/java-slack-sdk
version 1.45.3
Changes
- [bolt, slack-api-model, slack-api-client] #1437 upgrade gson to the latest version - Thanks @seratch
- [docs] #1430 bump the docusaurus group in /docs with 5 updates - Thanks @dependabot
- [ci] #1431 bump actions/stale from 9.0.0 to 9.1.0 - Thanks @dependabot
- [docs] #1434 update Bolt Java nav and Assistant doc to match JS structure - Thanks @technically-tracy
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/115?closed=1
- All changes: v1.45.2...v1.45.3
New Contributors
- @technically-tracy made their first contribution in #1434
version 1.45.2
Changes
- [slack-api-client] #1429 Fix #1426 IllegalStateException when deserializing message using conversations.history - Thanks @rasharab @seratch
- [slack-api-client] #1428 Consistently use the same OkHttpClient for files.slack.com requests - Thanks @seratch
- [slack-api-client] #1427 Add channels param to files.upload v2 method (and its underlying files.completeUploadExternal) - Thanks @seratch
- [slack-api-model] #1420 Add #1416 Add expand property to SectionBlock class - Thanks @ESteanes @seratch
- [bolt] #1421 Fix #1417 Change socket mode ping/pong from debug to trace - Thanks @bruceadowns @seratch
- [bolt] #1419 Fix #1418 Expose AwsCredentialsProvider to AmazonS3InstallationService - Thanks @bruceadowns @seratch
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/114?closed=1
- All changes: v1.45.1...v1.45.2
version 1.45.1
Changes
- [bolt] #1415 Fix #1414 botMessage handler in Assistant middleware does not work when other event listeners do not exist - Thanks @rbioteau @seratch
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/113?closed=1
- All changes: v1.45.0...v1.45.1
version 1.45.0
Announcement
AWS S3 SDK Migration
This version upgrades the underlying AWS S3 SDK to version 2. If you use the optional module, please switch to their v2 SDK. Note that AWS has changed both the groupId and artifactId for v2:
- <groupId>com.amazonaws</groupId>
- <artifactId>aws-java-sdk-s3</artifactId>
+ <groupId>software.amazon.awssdk</groupId>
+ <artifactId>s3</artifactId>
Also, here is an example of a version range:
- <aws.s3.version>[1.12.62,1.13.0)</aws.s3.version>
+ <aws.s3.version>[2.29.24,3)</aws.s3.version>
Refer to #1402 for more details.
Long-deprecated Legacy Module Removal
This version removes the "javax.servlet-api" artifact from the slack-app-backend library. The dependency is in "provided" scope and is only used by two long-deprecated classes. Those classes will be removed too:
- com.slack.api.app_backend.events.servlet.SlackEventsApiServlet
- com.slack.api.app_backend.events.servlet.SlackSignatureVerifier
The reason why we've removed these classes is that having the javax.servlet dependency can be a noise for developers and admins who are examining the progress of the Jakarta Servlet migration (even though it's in "provided" scope). We believe almost zero existing apps rely on these classes, but if there is any, please consider 1) migrating to bolt-java module or 2) copying the classes to your project. Please refer to #1412 for more details.
Changes
- [bolt] #1403 Fix #1402 Migrating AWS S3 SDK to v2 - Thanks @seratch
- [bolt] #1411 Fix #1409 Socket Mode: Slow message consumption when listeners do not immediately return ack() - Thanks @Mugenor @seratch
- [slack-app-backend] #1412 Remove long-deprecated javax.servlet modules from slack-app-backend library - Thanks @seratch
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/112?closed=1
- All changes: v1.44.2...v1.45.0
version 1.44.2
Changes
- [slack-api-client] #1397 NumberFormatException when using conversations.history - Thanks @rasharab @seratch
- [slack-api-client] #1390 Add title to EventContext#setSuggestedPrompts argument list - Thanks @seratch
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/111?closed=1
- All changes: v1.44.1...v1.44.2
version 1.44.1
Changes
- [bolt] #1389 Fix a bug where parsing assistant thread message event fails for beta feature enabled apps - Thanks @seratch
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/110?closed=1
- All changes: v1.44.0...v1.44.1
version 1.44.0
New Features
Agents & Assistants
A better Agents & Assistants support in Bolt is now available!
While you already can implement your agents using app.event(...)
listeners for assistant_thread_started
, assistant_thread_context_changed
, and message
events, Bolt offers a simpler approach. You just need to create an Assistant
instance, attach the needed event handlers to it, and then add the assistant to your App
instance.
App app = new App();
Assistant assistant = new Assistant(app.executorService());
assistant.threadStarted((req, ctx) -> {
try {
ctx.say(r -> r.text("Hi, how can I help you today?"));
ctx.setSuggestedPrompts(Collections.singletonList(
SuggestedPrompt.create("What does SLACK stand for?")
));
} catch (Exception e) {
ctx.logger.error("Failed to handle assistant thread started event: {e}", e);
}
});
assistant.userMessage((req, ctx) -> {
try {
ctx.setStatus("is typing...");
Thread.sleep(500L);
if (ctx.getThreadContext() != null) {
String contextChannel = ctx.getThreadContext().getChannelId();
ctx.say(r -> r.text("I am ware of the channel context: <#" + contextChannel + ">"));
} else {
ctx.say(r -> r.text("Here you are!"));
}
} catch (Exception e) {
ctx.logger.error("Failed to handle assistant thread started event: {e}", e);
try {
ctx.say(r -> r.text(":warning: Sorry, something went wrong during processing your request!"));
} catch (Exception ee) {
ctx.logger.error("Failed to inform the error to the end-user: {ee}", ee);
}
}
});
app.assistant(assistant);
Please refer to https://tools.slack.dev/java-slack-sdk/guides/assistants for more details.
Changes
- [bolt] #1372 #1383 Add Agents & Assistants document page - Thanks @seratch
- [bolt] #1388 Fix #1348 channel_convert_to_public message events - Thanks @seratch @mgroth0
- [bolt] #1380 Remove extra double quotes from the "Add to Slack" OAuth image alt text - Thanks @zimeg
- [slack-api-client] #1382 Add conversations.requestSharedInvite.list API support - Thanks @seratch
- [slack-api-client] #1376 Add RichTextBlock support to Block Kit Kotlin DSL builder - Thanks @KENNYSOFT
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/109?closed=1
- All changes: v1.43.1...v1.44.0
version 1.43.1
Changes
- [bolt] #1375 Fix #1147 Improve the logic to extract the requestUserId for context objects - Thanks @seratch
- [slack-api-client] #1374 Fix #1373 LogsResponse in AuditClient returns "ok: false" when request was a success - Thanks @Dunkhell @seratch
- [slack-api-client] Add missing properties in web API responses - Thanks @seratch
Additionaly, while #1377 is not a change for the main code, @KENNYSOFT significantly improved the test execution time by the PR. Thank you so much for the wonderful contribution!
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/108?closed=1
- All changes: v1.43.0...v1.43.1
version 1.43.0
Announcements
Assistant Apps in Bolt
This version includes the folllowing APIs and Events API payloads:
- https://api.slack.com/methods?query=assistant.threads
- https://api.slack.com/events?filter=Events&query=assistant_thread
We're planning to add a more convenient way to develop AI assistant apps in the near future, but we can already develop such with the following primitive code:
app.event(AssistantThreadStartedEvent.class, (req, ctx) -> {
String channelId = req.getEvent().getAssistantThread().getChannelId();
String threadTs = req.getEvent().getAssistantThread().getThreadTs();
app.executorService().submit(() -> {
try {
ctx.client().assistantThreadsSetTitle(r -> r.channelId(channelId).threadTs(threadTs).title("New chat"));
ctx.client().chatPostMessage(r -> r.channel(channelId).threadTs(threadTs).text("Hi, how can I help you today?"));
ctx.client().assistantThreadsSetSuggestedPrompts(r -> r.channelId(channelId).threadTs(threadTs).title("How are you?")
.prompts(Collections.singletonList(new SuggestedPrompt("What does SLACK stand for?")))
);
} catch (Exception e) {
ctx.logger.error("Failed to handle assistant thread started event: {e}", e);
}
});
return ctx.ack();
});
app.event(AssistantThreadContextChangedEvent.class, (req, ctx) -> {
app.executorService().submit(() -> {
String channelId = req.getEvent().getAssistantThread().getChannelId();
String threadTs = req.getEvent().getAssistantThread().getThreadTs();
// TODO: Store req.getEvent().getAssistantThread() for the following conversation
});
return ctx.ack();
});
app.event(MessageEvent.class, (req, ctx) -> {
if (req.getEvent().getChannelType().equals("im") && req.getEvent().getThreadTs() != null) {
String channelId = req.getEvent().getChannel();
String threadTs = req.getEvent().getThreadTs();
app.executorService().submit(() -> {
try {
ctx.client().assistantThreadsSetStatus(r -> r.channelId(channelId).threadTs(threadTs).status("is typing..."));
Thread.sleep(500L);
ctx.client().chatPostMessage(r -> r.channel(channelId).threadTs(threadTs).text("Here you are!"));
} catch (Exception e) {
ctx.logger.error("Failed to handle assistant thread started event: {e}", e);
try {
ctx.client().chatPostMessage(r -> r.channel(channelId).threadTs(threadTs).text(":warning: Sorry, something went wrong during processing your request!"));
} catch (Exception ee) {
ctx.logger.error("Failed to inform the error to the end-user: {ee}", ee);
}
}
});
}
return ctx.ack();
});
Changes
- [slack-api-client] #1371 Add assistant.threads.* APIs and related event payloads - Thanks @seratch
- [slack-api-client] Add missing properties in web API responses - Thanks @seratch
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/107?closed=1
- All changes: v1.42.1...v1.43.0
version 1.42.1
Changes
- [slack-api-client] #1365 Add conversations.requestSharedInvite.approve/deny APIs - Thanks @seratch
- [slack-api-client] #1362 Add interactivity_pointer to views.open/push API params - Thanks @seratch
- [slack-api-client] Add missing properties in web API responses - Thanks @seratch
- [slack-api-model] #1364 Fix #1363 Wrong element type for timestamp in RichTextSectionElement.Date - Thanks @jed204
- [bolt] #1355 Updating app_requested payload to include new field - Thanks @gugutagli
- All issues/pull requests: https://github.com/slackapi/java-slack-sdk/milestone/106?closed=1
- All changes: v1.42.0...v1.42.1