-
Notifications
You must be signed in to change notification settings - Fork 394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Better typing for block actions payload #2122
Comments
I 100% agree with you and we definitely want to improve this! Some of the underlying node packages that Bolt-JS relies on will need to tackle this feature, first, though. If you are curious, take a look at all the issues in the slackapi/node-slack-sdk repo tagged with the typescript label. Essentially, these payloads would need proper typing and would live in, I think, the I am itching to address this but work in this area has taken a backseat to other priorities. I will leave this issue open until we can add support to the underlying That would be a breaking change, though, I think, so I will also tag this as a major version issue and assign it to the 4.0 bolt milestone. |
I agree there are a few areas for improvement in this repo for TypeScript users: https://github.com/slackapi/bolt-js/issues?q=is%3Aissue+is%3Aopen+label%3ATypeScript-specific Nonetheless, specifically talking about the issue mentioned here, it seems there is some misinterpretation. The interactive message payload is the one for interactions within an attachment, not a block. Block action payload data is defined at https://github.com/slackapi/bolt-js/blob/main/src/types/actions/block-action.ts, and it correctly has all available properties, though its details can be improved. Hope this clarifies. |
Ahhh thank you @seratch for the clarification! My apologies, I missed that detail. Though, @sota1235 uses the Interactive Message as only an example; I read the implication in their original message as "this is just one area that is lacking in typing." We could certainly improve the Interactive Message type; the Block Action base payload used in Bolt does have the I feel like there's some way we could have |
I wish some block action body will have more correct typing.
For example, when I use InteractiveMessage type when I want to handle event for clicking button on message, that's type does not contain
container
payload. But actually it exists.I think it's intentional type, here is an official document.
https://api.slack.com/reference/interaction-payloads/block-actions#examples
Is there any blocker to implement this type? If not, I have a motivation to pull request.
Requirements
Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.
The text was updated successfully, but these errors were encountered: