-
Notifications
You must be signed in to change notification settings - Fork 399
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
Fix #720 ack(options) does not compile in TypeScript #878
Conversation
Codecov Report
@@ Coverage Diff @@
## main #878 +/- ##
=======================================
Coverage 66.08% 66.08%
=======================================
Files 13 13
Lines 1200 1200
Branches 353 353
=======================================
Hits 793 793
Misses 338 338
Partials 69 69
Continue to review full report at Codecov.
|
@@ -571,14 +571,16 @@ export default class App { | |||
this.listeners.push([onlyCommands, matchCommandName(commandName), ...listeners] as Middleware<AnyMiddlewareArgs>[]); | |||
} | |||
|
|||
public options<Source extends OptionsSource = OptionsSource>( | |||
public options<Source extends OptionsSource = 'block_suggestion'>( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only change in the main code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to see this land. I remembering running into this issue the first time I wanted to use ack
with options.
Summary
This pull request resolves #720
Most developers (perhaps 100%) handle only block_suggestion requests in
app.options
listeners. Thus, this pull request set the default Source toblock_suggestion
to ensure better developer experience in TypeScript.If a developer would like to handle either
interactive_message
(user actions on attachments) ordialog_suggestion
(the ones in legacy dialogs), the developer can have an explicit type parameter as below:Requirements (place an
x
in each[ ]
)