slackapi / slackapi/bolt-js

Introduce "mention()" middleware for catching all mentions in messages

Open
#611 2 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

discussion enhancement semver:minor
Dominant language
TypeScript
Stars
2.9k
Forks
446
Avg merge
1d 3h
Merged PRs (30d)
28

Description

Description

directMention() middleware matches only when a bot user is mentioned as the first person in a message. This is because the middleware was designed to be compatible with Hubot's robot.respond() functionality.

Also, Slapp (the ancestor of Bolt for JS) defines "direct mention" as being mentioned at the start of a message while "mention" means being mentioned anywhere in a message.

With full respect for the original meaning of "direct mention" in Slapp, I propose to add built-in mention() middleware to Bolt for JS. I'll be working on this sometime soon, but if anyone is interested in implementing this, any contribution is welcome!

What type of issue is this? (place an x in one of the [ ])
  • bug
  • enhancement (feature request)
  • question
  • documentation related
  • testing related
  • discussion
Requirements (place an x in each of the [ ])
  • 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 searched for any related issues and avoided creating a duplicate issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing directMention() middleware and compare its first-position behavior with the linked Slapp definitions of messageIsDirectMention and messageIsMention. Add a built-in mention() middleware that matches bot mentions anywhere in a message, then verify its behavior against the existing middleware coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
backend
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.