slackapi / slackapi/bolt-js

feat: Expose a `subtype` message pattern filter for `message` handlers

Open
#796 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Description

Unable to access thread_ts in message_replied message event payloads.

Bug Report

Filling out the following details about bugs will help us solve your issue sooner.

Reproducible in:

package version: ^3.2.0

node version: ^14

Expected result:

thread_ts will be available for messages

Actual result:

Compiler error

Code
  bolt.message(subtype('message_replied'), ({ message }) => {
    console.log(message.thread_ts);
  })

Property 'thread_ts' does not exist on type 'MessageEvent'.

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 at the bolt.message handler and subtype('message_replied') filter entry points shown in the issue, then trace the TypeScript definition of MessageEvent. Confirm how message subtypes are represented and update the handler typing so thread_ts is available for message_replied events; the example should compile without the reported error.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.