-
Notifications
You must be signed in to change notification settings - Fork 680
Description
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 the message_changed event containing the Slack user id.
The TypeScript interface for the MessageChangedEvent refers to the MessageEvent interface in the message and the previous_message properties that make TypeScript assume that accessing event.message.user is not allowed because not every subtype of the message 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 the message_changed event can reference to the message_changed event and so on.
Expected result:
- the
messageproperty of themessage_changedevent has the valid type according to the Slack docs - no TypeScript errors when accessing
event.message.userfor themessage_changedevent.
Actual result:
TS2339: Property 'user' does not exist on type 'MessageEvent'.