File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -160,19 +160,19 @@ To use the asyncio-based ones such as aiohttp, your app needs to be compatible w
160160 from slack_sdk.web.async_client import AsyncWebClient
161161 from slack_sdk.socket_mode.aiohttp import SocketModeClient
162162
163- # Initialize SocketModeClient with an app-level token + AsyncWebClient
164- client = SocketModeClient(
165- # This app-level token will be used only for establishing a connection
166- app_token = os.environ.get(" SLACK_APP_TOKEN" ), # xapp-A111-222-xyz
167- # You will be using this AsyncWebClient for performing Web API calls in listeners
168- web_client = AsyncWebClient(token = os.environ.get(" SLACK_BOT_TOKEN" )) # xoxb-111-222-xyz
169- )
170-
171163 # Use async method
172164 async def main ():
173165 from slack_sdk.socket_mode.response import SocketModeResponse
174166 from slack_sdk.socket_mode.request import SocketModeRequest
175167
168+ # Initialize SocketModeClient with an app-level token + AsyncWebClient
169+ client = SocketModeClient(
170+ # This app-level token will be used only for establishing a connection
171+ app_token = os.environ.get(" SLACK_APP_TOKEN" ), # xapp-A111-222-xyz
172+ # You will be using this AsyncWebClient for performing Web API calls in listeners
173+ web_client = AsyncWebClient(token = os.environ.get(" SLACK_BOT_TOKEN" )) # xoxb-111-222-xyz
174+ )
175+
176176 # Use async method
177177 async def process (client : SocketModeClient, req : SocketModeRequest):
178178 if req.type == " events_api" :
You can’t perform that action at this time.
0 commit comments