Skip to content

Commit 61172bb

Browse files
zimegClaude
andcommitted
feat: add entity.presentComments method
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 9f6e3ce commit 61172bb

4 files changed

Lines changed: 155 additions & 2 deletions

File tree

‎slack_sdk/web/async_client.py‎

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎slack_sdk/web/client.py‎

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4522,6 +4522,48 @@ def entity_acknowledgeCommentAction(
45224522
kwargs.update({"error": error})
45234523
return self.api_call("entity.acknowledgeCommentAction", json=kwargs)
45244524

4525+
def entity_presentComments(
4526+
self,
4527+
*,
4528+
comments: Sequence[Dict[str, Any]],
4529+
trigger_id: str,
4530+
cursor: Optional[str] = None,
4531+
can_post_comment: Optional[bool] = None,
4532+
delete_action_id: Optional[str] = None,
4533+
user_auth_required: Optional[bool] = None,
4534+
user_auth_url: Optional[str] = None,
4535+
error: Optional[Dict[str, Any]] = None,
4536+
**kwargs,
4537+
) -> SlackResponse:
4538+
"""Provide comments for Work Objects.
4539+
4540+
Apps call this method to send per-user flexpane comment data to the client.
4541+
https://docs.slack.dev/reference/methods/entity.presentComments
4542+
4543+
Args:
4544+
comments: Array of comments to present to the user.
4545+
trigger_id: A reference to the original user action that initiated the request
4546+
cursor: App supplied cursor used for pagination, will be sent in the next request for comments
4547+
can_post_comment: Indicates whether the user has permissions to post comments
4548+
delete_action_id: The block action id that will be sent when a delete request is initiated for a comment.
4549+
user_auth_required: Set to true (or 1) to indicate that the user must authenticate to see the comments data.
4550+
user_auth_url: A custom URL to which users are directed for authentication if required.
4551+
"""
4552+
kwargs.update({"comments": comments, "trigger_id": trigger_id})
4553+
if cursor is not None:
4554+
kwargs.update({"cursor": cursor})
4555+
if can_post_comment is not None:
4556+
kwargs.update({"can_post_comment": can_post_comment})
4557+
if delete_action_id is not None:
4558+
kwargs.update({"delete_action_id": delete_action_id})
4559+
if user_auth_required is not None:
4560+
kwargs.update({"user_auth_required": user_auth_required})
4561+
if user_auth_url is not None:
4562+
kwargs.update({"user_auth_url": user_auth_url})
4563+
if error is not None:
4564+
kwargs.update({"error": error})
4565+
return self.api_call("entity.presentComments", json=kwargs)
4566+
45254567
def entity_presentDetails(
45264568
self,
45274569
trigger_id: str,

‎slack_sdk/web/legacy_client.py‎

Lines changed: 42 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)