Skip to content

feat(methods): add chat.postMessage example#131

Draft
zimeg wants to merge 3 commits into
mainfrom
methods-examples
Draft

feat(methods): add chat.postMessage example#131
zimeg wants to merge 3 commits into
mainfrom
methods-examples

Conversation

@zimeg

@zimeg zimeg commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

This pull request adds a methods/ example set demonstrating individual Slack Web API method calls with the slack_sdk WebClient, starting with chat.postMessage.

  • New methods/ example, a sibling to block-kit/ (same src/ + tests/, ruff + mypy + pytest tooling).
  • src/chat/chat_post_message.py calls client.chat_postMessage(...), mirroring the WebClient usage shown in the docs.
  • tests/chat/test_chat_post_message.py points the client at a self-contained stdlib mock HTTP server (via WebClient(base_url=...)) and asserts the request hits chat.postMessage with the expected channel and text — no live workspace needed.
  • Lists the methods set in the repo README.

Testing

  • Set a bot token and run the example end-to-end: export SLACK_TOKEN="xoxb-..." then python -m src.chat.chat_post_message from the methods/ directory; confirm the message posts to the channel.

🤖 Generated with Claude Code

Add a methods/ example set demonstrating individual Slack Web API method
calls with the slack_sdk WebClient, starting with chat.postMessage. The
example mirrors the WebClient usage from the docs, and a test points the
client at a self-contained mock HTTP server (via base_url) asserting the
request hits chat.postMessage with the expected channel and text. Also
lists the methods set in the repo README.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
zimeg and others added 2 commits July 14, 2026 16:56
Add the methods example to the CI matrix so it is linted, type-checked,
and tested alongside block-kit.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Add a manifest.json alongside the chat example requesting only that
family's scopes (chat:write). Move the scope out of the README bullet into
the manifest and reference it from the run instructions, using the
method's exact docs description.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant