Skip to content
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

Add client to the list of args send through to listeners #354

Closed
4 of 9 tasks
marks opened this issue Dec 20, 2019 · 3 comments · Fixed by #359
Closed
4 of 9 tasks

Add client to the list of args send through to listeners #354

marks opened this issue Dec 20, 2019 · 3 comments · Fixed by #359
Labels
enhancement M-T: A feature request for new functionality

Comments

@marks
Copy link
Contributor

marks commented Dec 20, 2019

Description

Similar to #168, I'd like to propose that listeners (such as event, message, etc.) be able to access the @slack/web-api client. This would make it easier for listeners to make calls to the Web API methods while keeping the client rate-limit and queue-aware.

Without this, I either need to initialize my own web client in each file with listeners or pass app.client around manually

What type of issue is this? (place an x in one of the [ ])

  • bug
  • enhancement (feature request)
  • question
  • documentation 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.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.
@aoberoi aoberoi added the enhancement M-T: A feature request for new functionality label Dec 20, 2019
@aoberoi
Copy link
Contributor

aoberoi commented Dec 20, 2019

I think this is a good idea. There's no reason that I can think of that app.client is not offered to the middleware and listeners in an application.

@seratch
Copy link
Member

seratch commented Dec 22, 2019

I agree this is a missing piece for common use cases.

Regarding the possible changes, are you thinking to add client and logger to listener args like https://github.com/slackapi/bolt/blob/%40slack/bolt%401.5.0/src/types/command/index.ts#L7-L14 or add them to context? I prefer the former.

marks added a commit to marks/bolt that referenced this issue Dec 22, 2019
@marks
Copy link
Contributor Author

marks commented Dec 22, 2019

Hey @seratch - definitely want to add client and logger as listener args, not context

seratch added a commit to seratch/bolt-js that referenced this issue Dec 24, 2019
seratch added a commit to seratch/bolt-js that referenced this issue Jan 30, 2020
seratch added a commit that referenced this issue Feb 4, 2020
Fix #168 #354 Add `logger`, `client` to the list of args send through to listeners
seratch added a commit to seratch/bolt-js that referenced this issue Feb 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement M-T: A feature request for new functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants