Skip to content

Commit 20d250f

Browse files
committed
version 1.16.4
1 parent 99e77eb commit 20d250f

File tree

10 files changed

+129
-51
lines changed

10 files changed

+129
-51
lines changed

docs/api-docs/slack_bolt/app/app.html

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,16 @@ <h1 class="title">Module <code>slack_bolt.app.app</code></h1>
245245

246246
self._authorize: Optional[Authorize] = None
247247
if authorize is not None:
248-
if oauth_settings is not None or oauth_flow is not None:
249-
raise BoltError(error_authorize_conflicts())
250-
self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize)
248+
if isinstance(authorize, Authorize):
249+
# As long as an advanced developer understands what they&#39;re doing,
250+
# bolt-python should not prevent customizing authorize middleware
251+
self._authorize = authorize
252+
else:
253+
if oauth_settings is not None or oauth_flow is not None:
254+
# If the given authorize is a simple function,
255+
# it does not work along with installation_store.
256+
raise BoltError(error_authorize_conflicts())
257+
self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize)
251258

252259
self._installation_store: Optional[InstallationStore] = installation_store
253260
if self._installation_store is not None and self._authorize is None:
@@ -764,7 +771,7 @@ <h1 class="title">Module <code>slack_bolt.app.app</code></h1>
764771

765772
def message(
766773
self,
767-
keyword: Union[str, Pattern],
774+
keyword: Union[str, Pattern] = &#34;&#34;,
768775
matchers: Optional[Sequence[Callable[..., bool]]] = None,
769776
middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
770777
) -&gt; Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
@@ -1669,9 +1676,16 @@ <h2 id="args">Args</h2>
16691676

16701677
self._authorize: Optional[Authorize] = None
16711678
if authorize is not None:
1672-
if oauth_settings is not None or oauth_flow is not None:
1673-
raise BoltError(error_authorize_conflicts())
1674-
self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize)
1679+
if isinstance(authorize, Authorize):
1680+
# As long as an advanced developer understands what they&#39;re doing,
1681+
# bolt-python should not prevent customizing authorize middleware
1682+
self._authorize = authorize
1683+
else:
1684+
if oauth_settings is not None or oauth_flow is not None:
1685+
# If the given authorize is a simple function,
1686+
# it does not work along with installation_store.
1687+
raise BoltError(error_authorize_conflicts())
1688+
self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize)
16751689

16761690
self._installation_store: Optional[InstallationStore] = installation_store
16771691
if self._installation_store is not None and self._authorize is None:
@@ -2188,7 +2202,7 @@ <h2 id="args">Args</h2>
21882202

21892203
def message(
21902204
self,
2191-
keyword: Union[str, Pattern],
2205+
keyword: Union[str, Pattern] = &#34;&#34;,
21922206
matchers: Optional[Sequence[Callable[..., bool]]] = None,
21932207
middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
21942208
) -&gt; Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
@@ -3455,7 +3469,7 @@ <h2 id="args">Args</h2>
34553469
</details>
34563470
</dd>
34573471
<dt id="slack_bolt.app.app.App.message"><code class="name flex">
3458-
<span>def <span class="ident">message</span></span>(<span>self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, <a title="slack_bolt.middleware.middleware.Middleware" href="../middleware/middleware.html#slack_bolt.middleware.middleware.Middleware">Middleware</a>]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[<a title="slack_bolt.response.response.BoltResponse" href="../response/response.html#slack_bolt.response.response.BoltResponse">BoltResponse</a>]]]]</span>
3472+
<span>def <span class="ident">message</span></span>(<span>self, keyword: Union[str, Pattern] = '', matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, <a title="slack_bolt.middleware.middleware.Middleware" href="../middleware/middleware.html#slack_bolt.middleware.middleware.Middleware">Middleware</a>]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[<a title="slack_bolt.response.response.BoltResponse" href="../response/response.html#slack_bolt.response.response.BoltResponse">BoltResponse</a>]]]]</span>
34593473
</code></dt>
34603474
<dd>
34613475
<div class="desc"><p>Registers a new message event listener. This method can be used as either a decorator or a method.
@@ -3488,7 +3502,7 @@ <h2 id="args">Args</h2>
34883502
</summary>
34893503
<pre><code class="python">def message(
34903504
self,
3491-
keyword: Union[str, Pattern],
3505+
keyword: Union[str, Pattern] = &#34;&#34;,
34923506
matchers: Optional[Sequence[Callable[..., bool]]] = None,
34933507
middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
34943508
) -&gt; Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:

docs/api-docs/slack_bolt/app/async_app.html

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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&#39;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] = &#34;&#34;,
799805
matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
800806
middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
801807
) -&gt; 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&#39;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] = &#34;&#34;,
21212133
matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
21222134
middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
21232135
) -&gt; 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] = &#34;&#34;,
34503462
matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
34513463
middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
34523464
) -&gt; Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:

docs/api-docs/slack_bolt/app/index.html

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,16 @@ <h2 id="args">Args</h2>
292292

293293
self._authorize: Optional[Authorize] = None
294294
if authorize is not None:
295-
if oauth_settings is not None or oauth_flow is not None:
296-
raise BoltError(error_authorize_conflicts())
297-
self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize)
295+
if isinstance(authorize, Authorize):
296+
# As long as an advanced developer understands what they&#39;re doing,
297+
# bolt-python should not prevent customizing authorize middleware
298+
self._authorize = authorize
299+
else:
300+
if oauth_settings is not None or oauth_flow is not None:
301+
# If the given authorize is a simple function,
302+
# it does not work along with installation_store.
303+
raise BoltError(error_authorize_conflicts())
304+
self._authorize = CallableAuthorize(logger=self._framework_logger, func=authorize)
298305

299306
self._installation_store: Optional[InstallationStore] = installation_store
300307
if self._installation_store is not None and self._authorize is None:
@@ -811,7 +818,7 @@ <h2 id="args">Args</h2>
811818

812819
def message(
813820
self,
814-
keyword: Union[str, Pattern],
821+
keyword: Union[str, Pattern] = &#34;&#34;,
815822
matchers: Optional[Sequence[Callable[..., bool]]] = None,
816823
middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
817824
) -&gt; Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:
@@ -2078,7 +2085,7 @@ <h2 id="args">Args</h2>
20782085
</details>
20792086
</dd>
20802087
<dt id="slack_bolt.app.App.message"><code class="name flex">
2081-
<span>def <span class="ident">message</span></span>(<span>self, keyword: Union[str, Pattern], matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, <a title="slack_bolt.middleware.middleware.Middleware" href="../middleware/middleware.html#slack_bolt.middleware.middleware.Middleware">Middleware</a>]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[<a title="slack_bolt.response.response.BoltResponse" href="../response/response.html#slack_bolt.response.response.BoltResponse">BoltResponse</a>]]]]</span>
2088+
<span>def <span class="ident">message</span></span>(<span>self, keyword: Union[str, Pattern] = '', matchers: Optional[Sequence[Callable[..., bool]]] = None, middleware: Optional[Sequence[Union[Callable, <a title="slack_bolt.middleware.middleware.Middleware" href="../middleware/middleware.html#slack_bolt.middleware.middleware.Middleware">Middleware</a>]]] = None) ‑> Callable[..., Optional[Callable[..., Optional[<a title="slack_bolt.response.response.BoltResponse" href="../response/response.html#slack_bolt.response.response.BoltResponse">BoltResponse</a>]]]]</span>
20822089
</code></dt>
20832090
<dd>
20842091
<div class="desc"><p>Registers a new message event listener. This method can be used as either a decorator or a method.
@@ -2111,7 +2118,7 @@ <h2 id="args">Args</h2>
21112118
</summary>
21122119
<pre><code class="python">def message(
21132120
self,
2114-
keyword: Union[str, Pattern],
2121+
keyword: Union[str, Pattern] = &#34;&#34;,
21152122
matchers: Optional[Sequence[Callable[..., bool]]] = None,
21162123
middleware: Optional[Sequence[Union[Callable, Middleware]]] = None,
21172124
) -&gt; Callable[..., Optional[Callable[..., Optional[BoltResponse]]]]:

docs/api-docs/slack_bolt/async_app.html

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -403,10 +403,16 @@ <h2 id="args">Args</h2>
403403

404404
self._async_authorize: Optional[AsyncAuthorize] = None
405405
if authorize is not None:
406-
if oauth_settings is not None or oauth_flow is not None:
407-
raise BoltError(error_authorize_conflicts())
408-
409-
self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize)
406+
if isinstance(authorize, AsyncAuthorize):
407+
# As long as an advanced developer understands what they&#39;re doing,
408+
# bolt-python should not prevent customizing authorize middleware
409+
self._async_authorize = authorize
410+
else:
411+
if oauth_settings is not None or oauth_flow is not None:
412+
# If the given authorize is a simple function,
413+
# it does not work along with installation_store.
414+
raise BoltError(error_authorize_conflicts())
415+
self._async_authorize = AsyncCallableAuthorize(logger=self._framework_logger, func=authorize)
410416

411417
self._async_installation_store: Optional[AsyncInstallationStore] = installation_store
412418
if self._async_installation_store is not None and self._async_authorize is None:
@@ -948,7 +954,7 @@ <h2 id="args">Args</h2>
948954

949955
def message(
950956
self,
951-
keyword: Union[str, Pattern],
957+
keyword: Union[str, Pattern] = &#34;&#34;,
952958
matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
953959
middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
954960
) -&gt; Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:
@@ -2244,7 +2250,7 @@ <h2 id="args">Args</h2>
22442250
</details>
22452251
</dd>
22462252
<dt id="slack_bolt.async_app.AsyncApp.message"><code class="name flex">
2247-
<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>
2253+
<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>
22482254
</code></dt>
22492255
<dd>
22502256
<div class="desc"><p>Registers a new message event listener. This method can be used as either a decorator or a method.
@@ -2277,7 +2283,7 @@ <h2 id="args">Args</h2>
22772283
</summary>
22782284
<pre><code class="python">def message(
22792285
self,
2280-
keyword: Union[str, Pattern],
2286+
keyword: Union[str, Pattern] = &#34;&#34;,
22812287
matchers: Optional[Sequence[Callable[..., Awaitable[bool]]]] = None,
22822288
middleware: Optional[Sequence[Union[Callable, AsyncMiddleware]]] = None,
22832289
) -&gt; Callable[..., Optional[Callable[..., Awaitable[Optional[BoltResponse]]]]]:

0 commit comments

Comments
 (0)