Skip to content

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

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

feat(methods): add chat.postMessage example#47
zimeg wants to merge 2 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 module demonstrating individual Slack Web API method calls with slack-api-client, starting with chat.postMessage.

  • New methods/ Maven module, a sibling to block-kit/.
  • chat.ChatPostMessage mirrors the canonical docs snippet: build a ChatPostMessageRequest and call methods.chatPostMessage(request).
  • A ChatPostMessageTest points the client at a self-contained OkHttp MockWebServer (via SlackConfig.setMethodsEndpointUrlPrefix) 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 mvn compile exec:java -Dexec.mainClass=chat.ChatPostMessage from the methods/ directory; confirm the message posts to the channel.

🤖 Generated with Claude Code

Add a methods/ example module demonstrating individual Slack Web API
method calls with slack-api-client, starting with chat.postMessage. The
example mirrors the canonical docs snippet (MethodsClient +
ChatPostMessageRequest.builder()), and a MockWebServer test verifies 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>
Add the methods example module to the CI matrix so it is spotless-checked
and tested alongside block-kit.

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