Skip to content

Commit ef42ea9

Browse files
committed
Fix initialization in App/AsyncApp constructor
1 parent 0220e89 commit ef42ea9

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

slack_bolt/app/app.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,10 @@ def __init__(
130130
else:
131131
self._client = create_web_client(token) # NOTE: the token here can be None
132132

133+
# --------------------------------------
134+
# Authorize & OAuthFlow initialization
135+
# --------------------------------------
136+
133137
self._authorize: Optional[Authorize] = None
134138
if authorize is not None:
135139
if oauth_settings is not None or oauth_flow is not None:
@@ -192,6 +196,13 @@ def __init__(
192196
self._token = None
193197
self._framework_logger.warning(warning_token_skipped())
194198

199+
# after setting bot_only here, __init__ cannot replace authorize function
200+
self._authorize.bot_only = installation_store_bot_only
201+
202+
# --------------------------------------
203+
# Middleware Initialization
204+
# --------------------------------------
205+
195206
self._middleware_list: List[Union[Callable, Middleware]] = []
196207
self._listeners: List[Listener] = []
197208

slack_bolt/app/async_app.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,10 @@ def __init__(
141141
# NOTE: the token here can be None
142142
self._async_client = create_async_web_client(token)
143143

144+
# --------------------------------------
145+
# Authorize & OAuthFlow initialization
146+
# --------------------------------------
147+
144148
self._async_authorize: Optional[AsyncAuthorize] = None
145149
if authorize is not None:
146150
if oauth_settings is not None or oauth_flow is not None:
@@ -214,6 +218,13 @@ def __init__(
214218
self._token = None
215219
self._framework_logger.warning(warning_token_skipped())
216220

221+
# after setting bot_only here, __init__ cannot replace authorize function
222+
self._async_authorize.bot_only = installation_store_bot_only
223+
224+
# --------------------------------------
225+
# Middleware Initialization
226+
# --------------------------------------
227+
217228
self._async_middleware_list: List[Union[Callable, AsyncMiddleware]] = []
218229
self._async_listeners: List[AsyncListener] = []
219230

0 commit comments

Comments
 (0)