You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm writing a Slack app in TypeScript, and I'm having trouble extracting the trigger_id from a block action. It looks like this could be a TypeScript issue, because trigger_iddoes exist on the BlockAction type.
What type of issue is this?
bug
enhancement (feature request)
question
documentation related
testing related
discussion
Requirements
I've read and understood the Contributing guidelines and have done my best effort to follow them.
I've searched for any related issues and avoided creating a duplicate issue.
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 2.1.1
node version: 12.16.1
OS version(s): Ubuntu 20.04
Steps to reproduce:
Try out the following code (TypeScript):
app.action('callback_id',async({ ack, body })=>{awaitack();console.log(body.trigger_id);})
Observe red line under trigger_id (and compilation error)
Sob uncontrollably
Expected result:
I expected it to work.
Actual result:
😢
Attachments:
$ tsc
src/index.ts:65:20 - error TS2339: Property 'trigger_id' does not exist on type 'SlackAction'.
Property 'trigger_id' does not exist on type 'DialogSubmitAction'.
65 console.log(body.trigger_id)
~~~~~~~~~~
Found 1 error.
The text was updated successfully, but these errors were encountered:
Fixed; I had to do a type assertion on the body. Closing because it seems like it's a TypeScript thing.
This helped me out: microsoft/TypeScript#12815
import{BlockAction}from"@slack/bolt/dist/types/actions/block-action"app.action("callback_id",async({ ack, body })=>{ack();console.log((<BlockAction>body).trigger_id);});
Description
I'm writing a Slack app in TypeScript, and I'm having trouble extracting the
trigger_id
from a block action. It looks like this could be a TypeScript issue, becausetrigger_id
does exist on theBlockAction
type.What type of issue is this?
Requirements
Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version:
2.1.1
node version:
12.16.1
OS version(s):
Ubuntu 20.04
Steps to reproduce:
trigger_id
(and compilation error)Expected result:
I expected it to work.
Actual result:
😢
Attachments:
The text was updated successfully, but these errors were encountered: