11from typing import Callable , Optional , Awaitable
22
3- from slack_bolt .auth .result import AuthorizationResult
4- from slack_bolt .logger import get_bolt_logger
5- from slack_bolt .request .async_request import AsyncBoltRequest
6- from slack_bolt .response import BoltResponse
73from slack_sdk .errors import SlackApiError
84from slack_sdk .oauth .installation_store import Bot
95from slack_sdk .oauth .installation_store .async_installation_store import (
106 AsyncInstallationStore ,
117)
12- from slack_sdk .web .async_client import AsyncWebClient
8+
9+ from slack_bolt .auth .result import AuthorizationResult
10+ from slack_bolt .logger import get_bolt_logger
11+ from slack_bolt .request .async_request import AsyncBoltRequest
12+ from slack_bolt .response import BoltResponse
1313from .async_authorization import AsyncAuthorization
1414from .async_internals import _build_error_response , _is_no_auth_required
15+ from ...util .async_utils import create_async_web_client
1516
1617
1718class AsyncMultiTeamsAuthorization (AsyncAuthorization ):
@@ -55,7 +56,7 @@ async def async_process(
5556 )
5657 # TODO: bot -> user token
5758 req .context ["token" ] = bot .bot_token
58- req .context ["client" ] = AsyncWebClient ( token = bot .bot_token )
59+ req .context ["client" ] = create_async_web_client ( bot .bot_token )
5960 return await next ()
6061 else :
6162 # Just in case
@@ -71,7 +72,7 @@ async def async_process(
7172 )
7273 # TODO: bot -> user token
7374 req .context ["token" ] = bot .bot_token
74- req .context ["client" ] = AsyncWebClient ( token = bot .bot_token )
75+ req .context ["client" ] = create_async_web_client ( bot .bot_token )
7576 return next ()
7677
7778 except SlackApiError as e :
0 commit comments