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
When trying to use the listeners for app.event("app_home_opened", I can't access client from the middleware args because it is missing from the typing. (If I console.log the args as an object I can see client). The views.publish example code references using client from the middleware args: https://api.slack.com/methods/views.publish/code
Other examples from slack reference using app.client.views.publish, which is accessible, but results in a not_authd error from the web api. This might be because I have split my receiver initialization and my app installation (since I am incorporating bolt into an existing express api).
Ultimately, I would just like for client: WebClient to be added to the type.
What type of issue is this? (place an x in one of the [ ])
bug
enhancement (feature request)
question
documentation related
example code related
testing related
discussion
Requirements (place an x in each of the [ ])
I've read and understood the Contributing guidelines and have done my best effort to follow them.
To define your listener functions outside the app.event method arguments, you can go withe either of the following two approaches. I would recommend the first one in favor of simplicity:
Other examples from slack reference using app.client.views.publish, which is accessible, but results in a not_authd error from the web api. This might be because I have split my receiver initialization and my app installation (since I am incorporating bolt into an existing express api).
This sounds like a bit different issue. If your web API call receives not_authed error code in a response, that means that your API call does not have any access token for the call (if the token is invalid, you'll see invalid_auth instead).
If you don't use the client: WebClient in a listener argument list (the client as listener argument always holds a valid token resolved by authorize function), your code needs to manually set a valid token either when instantiating a WebClient instance or when performing an API call like client.views.publish({ token: 'valid-token', view: ... }).
👋 It looks like this issue has been open for 30 days with no activity. We'll mark this as stale for now, and wait 10 days for an update or for further comment before closing this issue out. If you think this issue needs to be prioritized, please comment to get the thread going again! Maintainers also review issues marked as stale on a regular basis and comment or adjust status if the issue needs to be reprioritized.
As this issue has been inactive for more than one month, we will be closing it. Thank you to all the participants! If you would like to raise a related issue, please create a new issue which includes your specific details and references this issue number.
Description
When trying to use the listeners for
app.event("app_home_opened"
, I can't access client from the middleware args because it is missing from the typing. (If I console.log the args as an object I can see client). The views.publish example code references using client from the middleware args: https://api.slack.com/methods/views.publish/codeOther examples from slack reference using app.client.views.publish, which is accessible, but results in a not_authd error from the web api. This might be because I have split my receiver initialization and my app installation (since I am incorporating bolt into an existing express api).
Ultimately, I would just like for client: WebClient to be added to the type.
What type of issue is this? (place an
x
in one of the[ ]
)Requirements (place an
x
in each of the[ ]
)Bug Report
Filling out the following details about bugs will help us solve your issue sooner.
Reproducible in:
package version: 3.8.1
node version: v14.16.1
OS version(s):
Steps to reproduce:
Expected result:
client should be accessible and be of type WebClient
Actual result:
client not part of the declared type.
Attachments:
Logs, screenshots, screencast, sample project, funny gif, etc.
The text was updated successfully, but these errors were encountered: