slackapi / node-slack-interactive-messages

Slack Buttons, Menus, and Dialogs made simpler for Node
MIT License
133 stars 41 forks source link

For each type of request, what are acceptable return vals for callback and args for respond #27

Closed aoberoi closed 6 years ago

aoberoi commented 6 years ago

Description

It's not clear on which types of requests, which values can be returned in the callback and/or passed to the respond() function. I've started to build a table to at least describe the current state of things. This has led to uncovering some behaviors that I think are bugs or unintended, but at least we should describe them.


Type of Request cb(): Message cb(): Promise<Message> respond(m: Message) respond(m: Promise<Message>) Notes
Message Action (Button, Select) incl. embeded in App Unfurl synchronous response if resolved under timeout, synchronous response; else response_url request response_url request (can be used several times) error: axios will likely throw
Dialog Submission synchronous response synchronous response response_url request (can be used several times) - not a replacement, used as follow up error: axios will likely throw A warning is logged if the synchronous response takes longer than the timeout
Menu Options synchronous response synchronous response - - A warning is logged if the synchronous response takes longer than the timeout

Edit: updated according to changes in #28

Requirements