Skip to content

Commit 7dc8689

Browse files
srajiangseratch
authored andcommitted
Tweak aiohttp documentation
1 parent a1ad5a4 commit 7dc8689

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

docs-src/socket-mode/index.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff 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":

0 commit comments

Comments
 (0)