feat: surface the setStatus argument to listeners if required event details are available#2843
Merged
Conversation
…details are available
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2843 +/- ##
==========================================
+ Coverage 93.58% 93.59% +0.01%
==========================================
Files 43 44 +1
Lines 7836 7853 +17
Branches 685 686 +1
==========================================
+ Hits 7333 7350 +17
Misses 498 498
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
zimeg
approved these changes
Mar 31, 2026
zimeg
left a comment
Member
There was a problem hiding this comment.
@WilliamBergamin No notes but praise. This builds so well on your earlier efforts 🏆 ✨
Comment on lines
+349
to
+352
| function createAssistantSetStatus(args: AllAssistantMiddlewareArgs): SetStatusFn { | ||
| const { client, payload } = args; | ||
| const { channelId: channel_id, threadTs: thread_ts } = extractThreadInfo(payload); | ||
|
|
||
| return (status: Parameters<SetStatusFn>[0]): Promise<AssistantThreadsSetStatusResponse> => { | ||
| if (typeof status === 'string') { | ||
| return client.assistant.threads.setStatus({ | ||
| channel_id, | ||
| thread_ts, | ||
| status, | ||
| }); | ||
| } | ||
| return client.assistant.threads.setStatus({ | ||
| channel_id, | ||
| thread_ts, | ||
| ...status, | ||
| }); | ||
| }; | ||
| const { channelId, threadTs } = extractThreadInfo(payload); | ||
| return createSetStatus(client, channelId, threadTs); |
Member
There was a problem hiding this comment.
🎨 praise: Beautiful implementation for extending this to other listeners!
Contributor
|
thanks for the thorough sample files! made testing a breeze 😀 |
srtaalej
approved these changes
Apr 2, 2026
srtaalej
left a comment
Contributor
There was a problem hiding this comment.
Working great for me ⭐ ⭐ 🚀
Member
|
@WilliamBergamin Thanks again for putting this together - let's merge it now! 🎁 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
These changes aim to widen the availability of
setStatusto mirror the patterns established bysayStreamsetStatusis available onapp.eventandapp.messagelisteners, if Bolt fails to extractchannelorthread_tsthensetStatuswill beundefinedTesting
npm pack .setStatusSample app.ts
manifest.json
{ "_metadata": { "major_version": 1, "minor_version": 1 }, "display_information": { "name": "set_status_experiment" }, "features": { "app_home": { "home_tab_enabled": false, "messages_tab_enabled": true, "messages_tab_read_only_enabled": false }, "bot_user": { "display_name": "set_status_experiment", "always_online": false } }, "oauth_config": { "scopes": { "bot": [ "app_mentions:read", "chat:write", "im:read", "im:write", "channels:history", "im:history" ] } }, "settings": { "event_subscriptions": { "bot_events": [ "app_mention", "message.im" ] }, "interactivity": { "is_enabled": true }, "org_deploy_enabled": true, "socket_mode_enabled": true, "token_rotation_enabled": false } }Requirements