Skip to content

Commit b657c29

Browse files
committed
version 0.2.0a9
1 parent 3db7459 commit b657c29

12 files changed

Lines changed: 27 additions & 22 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
]
3838
),
3939
include_package_data=True, # MANIFEST.in
40-
install_requires=["slack_sdk==3.0.0a1", ],
40+
install_requires=["slack_sdk==3.0.0a3", ],
4141
setup_requires=["pytest-runner==5.2"],
4242
tests_require=test_dependencies,
4343
test_suite="tests",

slack_bolt/context/ack/ack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from slack_bolt.context.ack.internals import _set_response
44
from slack_bolt.response.response import BoltResponse
5-
from slack_sdk.models.block_kit import Block
5+
from slack_sdk.models.blocks import Block
66

77

88
class Ack:

slack_bolt/context/ack/async_ack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from slack_bolt.context.ack.internals import _set_response
44
from slack_bolt.response.response import BoltResponse
5-
from slack_sdk.models.block_kit import Block
5+
from slack_sdk.models.blocks import Block
66

77

88
class AsyncAck:

slack_bolt/context/ack/internals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Optional, List, Union
22

3-
from slack_sdk.models.block_kit import Block
3+
from slack_sdk.models.blocks import Block
44

55
from slack_bolt.error import BoltError
66
from slack_bolt.response import BoltResponse

slack_bolt/context/say/async_say.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from slack_bolt.context.say.internals import _can_say
44
from slack_sdk.models.attachments import Attachment
5-
from slack_sdk.models.block_kit import Block
5+
from slack_sdk.models.blocks import Block
66
from slack_sdk.web.async_client import AsyncWebClient
77
from slack_sdk.web.async_slack_response import AsyncSlackResponse
88

slack_bolt/context/say/say.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from slack_bolt.context.say.internals import _can_say
44
from slack_sdk import WebClient
55
from slack_sdk.models.attachments import Attachment
6-
from slack_sdk.models.block_kit import Block
6+
from slack_sdk.models.blocks import Block
77
from slack_sdk.web import SlackResponse
88

99

slack_bolt/middleware/authorization/async_multi_teams_authorization.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
from 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
73
from slack_sdk.errors import SlackApiError
84
from slack_sdk.oauth.installation_store import Bot
95
from 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
1313
from .async_authorization import AsyncAuthorization
1414
from .async_internals import _build_error_response, _is_no_auth_required
15+
from ...util.async_utils import create_async_web_client
1516

1617

1718
class 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:

slack_bolt/middleware/authorization/multi_teams_authorization.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from slack_bolt.response import BoltResponse
77
from slack_sdk.errors import SlackApiError
88
from slack_sdk.oauth.installation_store import InstallationStore, Bot
9-
from slack_sdk.web import WebClient
109
from . import Authorization
1110
from .internals import _build_error_response, _is_no_auth_required
11+
from ...util.utils import create_web_client
1212

1313

1414
class MultiTeamsAuthorization(Authorization):
@@ -46,7 +46,7 @@ def process(
4646
)
4747
# TODO: bot -> user token
4848
req.context["token"] = bot.bot_token
49-
req.context["client"] = WebClient(token=bot.bot_token)
49+
req.context["client"] = create_web_client(bot.bot_token)
5050
return next()
5151
else:
5252
# Just in case
@@ -62,7 +62,7 @@ def process(
6262
)
6363
# TODO: bot -> user token
6464
req.context["token"] = bot.bot_token
65-
req.context["client"] = WebClient(token=bot.bot_token)
65+
req.context["client"] = create_web_client(bot.bot_token)
6666
return next()
6767

6868
except SlackApiError as e:

slack_bolt/oauth/oauth_flow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
from slack_sdk.oauth.state_store.sqlite3 import SQLite3OAuthStateStore
1919
from slack_sdk.web import WebClient, SlackResponse
2020

21+
from slack_bolt.util.utils import create_web_client
22+
2123

2224
class OAuthFlow:
2325
installation_store: InstallationStore
@@ -42,7 +44,7 @@ class OAuthFlow:
4244
@property
4345
def client(self) -> WebClient:
4446
if self._client is None:
45-
self._client = WebClient()
47+
self._client = create_web_client()
4648
return self._client
4749

4850
@property

slack_bolt/util/async_utils.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from slack_sdk.web.async_client import AsyncWebClient
44

5+
from slack_bolt.version import __version__ as bolt_version
6+
57

68
def create_async_web_client(token: Optional[str] = None) -> AsyncWebClient:
7-
# TODO: add bolt info to user-agent
8-
return AsyncWebClient(token=token)
9+
return AsyncWebClient(token=token, user_agent_prefix=f"Bolt-Async/{bolt_version}",)

0 commit comments

Comments
 (0)