Cannot access the user id in the "message_changed" event with TypeScript #2026
Labels
area:typescript
issues that specifically impact using the package from typescript projects
bug
M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented
enhancement
M-T: A feature request for new functionality
pkg:types
applies to `@slack/types`
semver:major
Milestone
Reproducible in:
The Slack SDK version
3.13.1
Node.js runtime version
v16.15.1
OS info
ProductName: macOS
ProductVersion: 12.6.5
BuildVersion: 21G531
Darwin Kernel Version 21.6.0: Thu Mar 9 20:08:59 PST 2023; root:xnu-8020.240.18.700.8~1/RELEASE_X86_64
Steps to reproduce:
The Slack docs say that there should be the
message.user
key in themessage_changed
event containing the Slack user id.The TypeScript interface for the
MessageChangedEvent
refers to theMessageEvent
interface in themessage
and theprevious_message
properties that make TypeScript assume that accessingevent.message.user
is not allowed because not every subtype of themessage
event contains a user id.It seems like the reference to the
MessageEvent
is incorrect because (I suppose) not every message can be edited and moreover it makes the circular dependency in types when themessage_changed
event can reference to themessage_changed
event and so on.Expected result:
message
property of themessage_changed
event has the valid type according to the Slack docsevent.message.user
for themessage_changed
event.Actual result:
The text was updated successfully, but these errors were encountered: