Skip to content

Commit 4e173ba

Browse files
zimegClaude
andcommitted
feat(methods): add entity.acknowledgeCommentAction method example
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
1 parent 686f1c6 commit 4e173ba

7 files changed

Lines changed: 63 additions & 0 deletions

File tree

‎methods/README.md‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ $ slack run chat_post_message.py # Make the request
6363

6464
- **[chat.postMessage](https://docs.slack.dev/reference/methods/chat.postmessage)**: Sends a message to a channel. [Implementation](./src/chat/chat_post_message.py).
6565

66+
### entity
67+
68+
- **[entity.acknowledgeCommentAction](https://docs.slack.dev/reference/methods/entity.acknowledgeCommentAction)**: Acknowledge a comment post, edit, or delete on a Work Object. Apps call this method to confirm they have processed a comment action. [Implementation](./src/entity/entity_acknowledge_comment_action.py).
69+
6670
### slackbot
6771

6872
- **[slackbot.skills.create](https://docs.slack.dev/reference/methods/slackbot.skills.create)**: Creates a skill from markdown instructions, or turns an existing canvas the caller owns into a skill. [Implementation](./src/slackbot/skills/slackbot_skills_create.py).
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
apps.dev.json
2+
cache/
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"manifest": {
3+
"source": "local"
4+
},
5+
"project_id": "00000000-0000-0000-0000-000000000000"
6+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"hooks": {
3+
"get-hooks": "python3 -m slack_cli_hooks.hooks.get_hooks"
4+
}
5+
}

‎methods/src/entity/__init__.py‎

Whitespace-only changes.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import os
2+
3+
from slack_sdk import WebClient
4+
5+
# Read a token from an environment variable
6+
token = os.environ.get("SLACK_TOKEN")
7+
8+
# Initialize
9+
client = WebClient(token=token)
10+
11+
# Call the entity.acknowledgeCommentAction method
12+
response = client.entity_acknowledgeCommentAction(
13+
trigger_id="1234567890123.1234567890123.abcdef01234567890abcdef012345689",
14+
comment={
15+
"id": "comment-unique-identifier-003",
16+
"sender": {
17+
"user_id": "U123456789",
18+
},
19+
"comment": {
20+
"value": "The saved comment text",
21+
"format": "markdown",
22+
},
23+
"timestamp": 1741164500,
24+
"url": "your.app/item/1/comment/3",
25+
"thread_root_id": "comment-unique-identifier-001",
26+
},
27+
)
28+
29+
# Inspect the response
30+
print(response)

‎methods/src/entity/manifest.json‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"display_information": {
3+
"name": "Slack API Methods",
4+
"description": "Example implementations to call \"entity\" methods"
5+
},
6+
"oauth_config": {
7+
"scopes": {
8+
"bot": []
9+
}
10+
},
11+
"settings": {
12+
"org_deploy_enabled": true,
13+
"socket_mode_enabled": false,
14+
"token_rotation_enabled": false
15+
}
16+
}

0 commit comments

Comments
 (0)