@@ -250,10 +250,16 @@ <h1 class="title">Module <code>slack_bolt.app.async_app</code></h1>
250250
251251 self._async_authorize: Optional[AsyncAuthorize] = None
252252 if authorize is not None:
253- if oauth_settings is not None or oauth_flow is not None:
254- raise BoltError(error_authorize_conflicts())
255-
256- self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize)
253+ if isinstance(authorize, AsyncAuthorize):
254+ # As long as an advanced developer understands what they're doing,
255+ # bolt-python should not prevent customizing authorize middleware
256+ self._async_authorize = authorize
257+ else:
258+ if oauth_settings is not None or oauth_flow is not None:
259+ # If the given authorize is a simple function,
260+ # it does not work along with installation_store.
261+ raise BoltError(error_authorize_conflicts())
262+ self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize)
257263
258264 self._async_installation_store: Optional[AsyncInstallationStore] = installation_store
259265 if self._async_installation_store is not None and self._async_authorize is None:
@@ -795,7 +801,7 @@ <h1 class="title">Module <code>slack_bolt.app.async_app</code></h1>
795801
796802 def message(
797803 self,
798- keyword: Union[str, Pattern],
804+ keyword: Union[str, Pattern] = "" ,
799805 matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
800806 middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
801807 ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
@@ -1572,10 +1578,16 @@ <h2 id="args">Args</h2>
15721578
15731579 self._async_authorize: Optional[AsyncAuthorize] = None
15741580 if authorize is not None:
1575- if oauth_settings is not None or oauth_flow is not None:
1576- raise BoltError(error_authorize_conflicts())
1577-
1578- self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize)
1581+ if isinstance(authorize, AsyncAuthorize):
1582+ # As long as an advanced developer understands what they're doing,
1583+ # bolt-python should not prevent customizing authorize middleware
1584+ self._async_authorize = authorize
1585+ else:
1586+ if oauth_settings is not None or oauth_flow is not None:
1587+ # If the given authorize is a simple function,
1588+ # it does not work along with installation_store.
1589+ raise BoltError(error_authorize_conflicts())
1590+ self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize)
15791591
15801592 self._async_installation_store: Optional[AsyncInstallationStore] = installation_store
15811593 if self._async_installation_store is not None and self._async_authorize is None:
@@ -2117,7 +2129,7 @@ <h2 id="args">Args</h2>
21172129
21182130 def message(
21192131 self,
2120- keyword: Union[str, Pattern],
2132+ keyword: Union[str, Pattern] = "" ,
21212133 matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
21222134 middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
21232135 ) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
@@ -3413,7 +3425,7 @@ <h2 id="args">Args</h2>
34133425</ details >
34143426</ dd >
34153427< dt id ="slack_bolt.app.async_app.AsyncApp.message "> < code class ="name flex ">
3416- < span > def < span class ="ident "> message</ span > </ span > (< span > self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, < a title ="slack_bolt.middleware.async_middleware.AsyncMiddleware " href ="../middleware/async_middleware.html#slack_bolt.middleware.async_middleware.AsyncMiddleware "> AsyncMiddleware</ a > ]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[< a title ="slack_bolt.response.response.BoltResponse " href ="../response/response.html#slack_bolt.response.response.BoltResponse "> BoltResponse</ a > ]]]]]</ span >
3428+ < span > def < span class ="ident "> message</ span > </ span > (< span > self, keyword: Union[str, Pattern] = '' , matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None, middleware: Optional[Sequence[Union[Callable, < a title ="slack_bolt.middleware.async_middleware.AsyncMiddleware " href ="../middleware/async_middleware.html#slack_bolt.middleware.async_middleware.AsyncMiddleware "> AsyncMiddleware</ a > ]]] = None) ‑> Callable[..., Optional[Callable[..., Awaitable[Optional[< a title ="slack_bolt.response.response.BoltResponse " href ="../response/response.html#slack_bolt.response.response.BoltResponse "> BoltResponse</ a > ]]]]]</ span >
34173429</ code > </ dt >
34183430< dd >
34193431< div class ="desc "> < p > Registers a new message event listener. This method can be used as either a decorator or a method.
@@ -3446,7 +3458,7 @@ <h2 id="args">Args</h2>
34463458</ summary >
34473459< pre > < code class ="python "> def message(
34483460 self,
3449- keyword: Union[str, Pattern],
3461+ keyword: Union[str, Pattern] = "" ,
34503462 matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
34513463 middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
34523464) -> Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
0 commit comments