Repository navigation
refactor: use say_stream helper instead of client.chat_stream - #82
Conversation
Replace manual client.chat_stream() calls with the say_stream context utility, which automatically injects channel, thread_ts, recipient IDs. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
srtaalej
left a comment
There was a problem hiding this comment.
This branch is 95 commits behind main but merges cleanly. On the merged result with main's deps (slack-bolt==1.30.0), ruff check and ruff format --check pass ✅ I checked against bolt's attaching_conversation_kwargs middleware that say_stream fills in the same channel, thread_ts, and recipient_user_id that were passed by hand before. It also falls back to enterprise_id for recipient_team_id, which is a small win for org installs. I didn't do a live run in Slack because I don't have a working token right now, so I checked this against the source instead.\n\nOne follow-up, not blocking: listeners/events/app_mentioned.py on main still calls client.chat_stream(...) by hand. It could switch to say_stream too, either here or in a follow-up, so the sample stays consistent. LGTM!
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
|
🌟 Thanks for the kind review @srtaalej! |
Summary
Replace manual
client.chat_stream()calls with thesay_streamcontext utility, which automatically injectschannel,thread_ts,recipient_team_id, andrecipient_user_idfrom the listener context.This simplifies the message handler by removing the need to manually extract and pass these values from
payloadandcontext.Requirements