Closed smoya closed 1 year ago
Hi @kanata2! Do you think this PR has a chance to be reviewed at any time soon? Thank you!
@smoya
Sorry for delay.
A very useful use case for this is reacting to those events from event handlers. I.e. :
Is it inconvenient to use slackevents.EventsAPIInnerEvent
? I still don't see much benefit to defining it.
@smoya
Sorry for delay.
A very useful use case for this is reacting to those events from event handlers. I.e. :
Is it inconvenient to use slackevents.EventsAPIInnerEvent
? I still don't see much benefit to defining it.
Is it inconvenient to use
slackevents.EventsAPIInnerEvent
? I still don't see much benefit to defining it.
I think you are right. It is more than enough for that use case.
Thanks
Description
This PR adds a new interface
EventsAPIInnerEventData
that all inner events will fulfill. At this time, with only one method (EventType()
) but open to grow according to https://api.slack.com/apis/connections/events-api#event_type_structure.A very useful use case for this is reacting to those events from event handlers. I.e. :
Alternatives
There is no good alternatives for this. I tried using generics but the immaturity of it made me drop the idea since you cannot use interface with constraints as types (See the type parameters proposal). E.g. the following is not allowed: