Skip to content

Commit 2e6e1f7

Browse files
zimegClaude
andcommitted
feat: add authorship arguments to SetStatus and AsyncSetStatus
Add icon_emoji, icon_url, and username parameters to set_status(), matching the new authorship support in slack_sdk v3.42.0. Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 9734e6f commit 2e6e1f7

4 files changed

Lines changed: 31 additions & 0 deletions

File tree

slack_bolt/context/set_status/async_set_status.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@ async def __call__(
2323
self,
2424
status: str,
2525
loading_messages: Optional[List[str]] = None,
26+
icon_emoji: Optional[str] = None,
27+
icon_url: Optional[str] = None,
28+
username: Optional[str] = None,
2629
**kwargs,
2730
) -> AsyncSlackResponse:
2831
return await self.client.assistant_threads_setStatus(
2932
channel_id=self.channel_id,
3033
thread_ts=self.thread_ts,
3134
status=status,
3235
loading_messages=loading_messages,
36+
icon_emoji=icon_emoji,
37+
icon_url=icon_url,
38+
username=username,
3339
**kwargs,
3440
)

slack_bolt/context/set_status/set_status.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@ def __call__(
2323
self,
2424
status: str,
2525
loading_messages: Optional[List[str]] = None,
26+
icon_emoji: Optional[str] = None,
27+
icon_url: Optional[str] = None,
28+
username: Optional[str] = None,
2629
**kwargs,
2730
) -> SlackResponse:
2831
return self.client.assistant_threads_setStatus(
2932
channel_id=self.channel_id,
3033
thread_ts=self.thread_ts,
3134
status=status,
3235
loading_messages=loading_messages,
36+
icon_emoji=icon_emoji,
37+
icon_url=icon_url,
38+
username=username,
3339
**kwargs,
3440
)

tests/slack_bolt/context/test_set_status.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,15 @@ def test_set_status_loading_messages(self):
3232
)
3333
assert response.status_code == 200
3434

35+
def test_set_status_authorship(self):
36+
set_status = SetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123")
37+
response: SlackResponse = set_status(
38+
status="Thinking...",
39+
icon_emoji=":maple_leaf:",
40+
username="Charlie Brown",
41+
)
42+
assert response.status_code == 200
43+
3544
def test_set_status_invalid(self):
3645
set_status = SetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123")
3746
with pytest.raises(TypeError):

tests/slack_bolt_async/context/test_async_set_status.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,16 @@ async def test_set_status_loading_messages(self):
4040
)
4141
assert response.status_code == 200
4242

43+
@pytest.mark.asyncio
44+
async def test_set_status_authorship(self):
45+
set_status = AsyncSetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123")
46+
response: AsyncSlackResponse = await set_status(
47+
status="Thinking...",
48+
icon_emoji=":maple_leaf:",
49+
username="Charlie Brown",
50+
)
51+
assert response.status_code == 200
52+
4353
@pytest.mark.asyncio
4454
async def test_set_status_invalid(self):
4555
set_status = AsyncSetStatus(client=self.web_client, channel_id="C111", thread_ts="123.123")

0 commit comments

Comments
 (0)