File tree Expand file tree Collapse file tree
slack_bolt/context/say_stream Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ async def __call__(
3434 recipient_team_id : Optional [str ] = None ,
3535 recipient_user_id : Optional [str ] = None ,
3636 thread_ts : Optional [str ] = None ,
37+ icon_emoji : Optional [str ] = None ,
38+ icon_url : Optional [str ] = None ,
39+ username : Optional [str ] = None ,
3740 ** kwargs ,
3841 ) -> AsyncChatStream :
3942 """Starts a new chat stream with context."""
@@ -51,12 +54,18 @@ async def __call__(
5154 recipient_team_id = recipient_team_id or self .recipient_team_id ,
5255 recipient_user_id = recipient_user_id or self .recipient_user_id ,
5356 thread_ts = thread_ts ,
57+ icon_emoji = icon_emoji ,
58+ icon_url = icon_url ,
59+ username = username ,
5460 ** kwargs ,
5561 )
5662 return await self .client .chat_stream (
5763 channel = channel ,
5864 recipient_team_id = recipient_team_id or self .recipient_team_id ,
5965 recipient_user_id = recipient_user_id or self .recipient_user_id ,
6066 thread_ts = thread_ts ,
67+ icon_emoji = icon_emoji ,
68+ icon_url = icon_url ,
69+ username = username ,
6170 ** kwargs ,
6271 )
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ def __call__(
3434 recipient_team_id : Optional [str ] = None ,
3535 recipient_user_id : Optional [str ] = None ,
3636 thread_ts : Optional [str ] = None ,
37+ icon_emoji : Optional [str ] = None ,
38+ icon_url : Optional [str ] = None ,
39+ username : Optional [str ] = None ,
3740 ** kwargs ,
3841 ) -> ChatStream :
3942 """Starts a new chat stream with context."""
@@ -51,12 +54,18 @@ def __call__(
5154 recipient_team_id = recipient_team_id or self .recipient_team_id ,
5255 recipient_user_id = recipient_user_id or self .recipient_user_id ,
5356 thread_ts = thread_ts ,
57+ icon_emoji = icon_emoji ,
58+ icon_url = icon_url ,
59+ username = username ,
5460 ** kwargs ,
5561 )
5662 return self .client .chat_stream (
5763 channel = channel ,
5864 recipient_team_id = recipient_team_id or self .recipient_team_id ,
5965 recipient_user_id = recipient_user_id or self .recipient_user_id ,
6066 thread_ts = thread_ts ,
67+ icon_emoji = icon_emoji ,
68+ icon_url = icon_url ,
69+ username = username ,
6170 ** kwargs ,
6271 )
Original file line number Diff line number Diff line change @@ -98,3 +98,24 @@ def test_buffer_size_overrides(self):
9898 "icon_url" : None ,
9999 "username" : None ,
100100 }
101+
102+ def test_authorship_overrides (self ):
103+ say_stream = SayStream (
104+ client = self .web_client ,
105+ channel = "C111" ,
106+ recipient_team_id = "T111" ,
107+ recipient_user_id = "U111" ,
108+ thread_ts = "111.222" ,
109+ )
110+ stream = say_stream (icon_emoji = ":maple_leaf:" , username = "Charlie Brown" )
111+
112+ assert stream ._stream_args == {
113+ "channel" : "C111" ,
114+ "thread_ts" : "111.222" ,
115+ "recipient_team_id" : "T111" ,
116+ "recipient_user_id" : "U111" ,
117+ "task_display_mode" : None ,
118+ "icon_emoji" : ":maple_leaf:" ,
119+ "icon_url" : None ,
120+ "username" : "Charlie Brown" ,
121+ }
Original file line number Diff line number Diff line change @@ -111,3 +111,25 @@ async def test_buffer_size_overrides(self):
111111 "icon_url" : None ,
112112 "username" : None ,
113113 }
114+
115+ @pytest .mark .asyncio
116+ async def test_authorship_overrides (self ):
117+ say_stream = AsyncSayStream (
118+ client = self .web_client ,
119+ channel = "C111" ,
120+ recipient_team_id = "T111" ,
121+ recipient_user_id = "U111" ,
122+ thread_ts = "111.222" ,
123+ )
124+ stream = await say_stream (icon_emoji = ":maple_leaf:" , username = "Charlie Brown" )
125+
126+ assert stream ._stream_args == {
127+ "channel" : "C111" ,
128+ "thread_ts" : "111.222" ,
129+ "recipient_team_id" : "T111" ,
130+ "recipient_user_id" : "U111" ,
131+ "task_display_mode" : None ,
132+ "icon_emoji" : ":maple_leaf:" ,
133+ "icon_url" : None ,
134+ "username" : "Charlie Brown" ,
135+ }
You can’t perform that action at this time.
0 commit comments