You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
:::tip [The Python Slack SDK provides a [`chat_stream()`](https://docss.slack.dev/tools/python-slack-sdk/reference/web/client.html#slack_sdk.web.client.WebClient.chat_stream) helper utility to streamline calling these methods.]
64
+
:::tip [The Python Slack SDK provides a [`chat_stream()`](/tools/python-slack-sdk/reference/web/client.html#slack_sdk.web.client.WebClient.chat_stream) helper utility to streamline calling these methods.]
65
65
66
66
See the [_Streaming messages_](/tools/bolt-python/concepts/message-sending#streaming-messages) section of the Bolt for Python docs for implementation instructions.
67
67
@@ -75,12 +75,16 @@ First you need to begin the message stream:
75
75
# Example: Stream a response to any message
76
76
@app.message()
77
77
defhandle_message(message, client):
78
-
channel_id = payload["channel"]
79
-
thread_ts = payload["thread_ts"]
78
+
channel_id = event.get("channel")
79
+
team_id = event.get("team")
80
+
thread_ts = event.get("thread_ts") or event.get("ts")
81
+
user_id = event.get("user")
80
82
81
83
# Start a new message stream
82
84
stream_response = client.chat_startStream(
83
85
channel=channel_id,
86
+
recipient_team_id=team_id,
87
+
recipient_user_id=user_id,
84
88
thread_ts=thread_ts,
85
89
)
86
90
stream_ts = stream_response["ts"]
@@ -117,7 +121,7 @@ Your app can then end the stream with the `chat_stopStream` method:
117
121
)
118
122
```
119
123
120
-
The method also provides you an opportunity to request user feedback on your app's responses using the [feedback buttons](/reference/block-kit/block-elements/feedback-buttons-element) block element within the [context actions](/reference/block-kit/blocks/context-actions-block) block. The user will be presented with thumbs up and thumbs down buttons.
124
+
The method also provides you an opportunity to request user feedback on your app's responses using the [feedback buttons](/reference/block-kit/block-elements/feedback-buttons-element) block element within the [context actions](/reference/block-kit/blocks/context-actions-block) block. The user will be presented with thumbs up and thumbs down buttons which send an action to your app when pressed.
0 commit comments