Skip to content

docs: filter against bot_id in listener middleware example - #1339

Merged
zimeg merged 1 commit into
mainfrom
zimeg-docs-middleware
Jul 25, 2025
Merged

docs: filter against bot_id in listener middleware example#1339
zimeg merged 1 commit into
mainfrom
zimeg-docs-middleware

Conversation

@zimeg

Copy link
Copy Markdown
Member

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.

@zimegzimeg self-assigned this Jul 22, 2025
@zimegzimeg added the docs Improvements or additions to documentation label Jul 22, 2025
@codecov

codecovBot commented Jul 22, 2025

Copy link
Copy Markdown

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.


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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

かんぱい

@zimeg

Copy link
Copy Markdown
MemberAuthor

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

@zimeg
zimeg merged commit beba392 into mainJul 25, 2025
16 checks passed
@zimeg
zimeg deleted the zimeg-docs-middleware branch July 25, 2025 02:49
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docsImprovements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@zimeg@lukegalbraithrussell