Skip to content

Conversation

zimeg
Copy link
Member

@zimeg zimeg commented Jul 22, 2025

Summary

This PR updates the listener middleware example to filter out bot messages according to a bot_id value to match the changes of slackapi/bolt-js#2610:

In classic Slack apps, the bot_message event is sent when a message is sent to a channel by an integration "bot". It is like a normal user message, except it has no associated user. With current Slack apps, also known as granular bot permissions (GBP) apps, you can detect if a message was sent by a bot by the presence of the bot_id and bot_profile fields in the event payload.

🔗 https://api.slack.com/events/message/bot_message

Testing

The updated examples can be used as a proof of concept!

Category

  • Document pages under /docs

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@zimeg zimeg self-assigned this Jul 22, 2025
@zimeg zimeg added the docs Improvements or additions to documentation label Jul 22, 2025
Copy link

codecov bot commented Jul 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.96%. Comparing base (88ddc7c) to head (4f10adb).
Report is 1 commits behind head on main.

✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1339   +/-   ##
=======================================
  Coverage   90.96%   90.96%           
=======================================
  Files         222      222           
  Lines        7501     7501           
=======================================
  Hits         6823     6823           
  Misses        678      678           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -11,11 +11,10 @@ slug: /concepts/listener-middleware
<span>指定可能な引数の一覧は<a href="https://tools.slack.dev/bolt-python/api-docs/slack_bolt/kwargs_injection/args.html">モジュールドキュメント</a>を参考にしてください。</span>

```python
# "bot_message" サブタイプのメッセージを抽出するリスナーミドルウェア
# ボットからのメッセージをフィルタリングするリスナーミドルウェア
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

かんぱい

@zimeg
Copy link
Member Author

zimeg commented Jul 25, 2025

@lukegalbraithrussell I so much appreciate the review - let's now merge this 👾 ✨

@zimeg zimeg merged commit beba392 into main Jul 25, 2025
16 checks passed
@zimeg zimeg deleted the zimeg-docs-middleware branch July 25, 2025 02:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants