Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions slack_bolt/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -1401,7 +1401,7 @@ def _init_context(self, req: BoltRequest):
# For AI Agents & Assistants
if is_assistant_event(req.body):
assistant = AssistantUtilities(
payload=to_event(req.body), # type:ignore[arg-type]
payload=to_event(req.body), # type: ignore[arg-type]
context=req.context,
thread_context_store=self._assistant_thread_context_store,
)
Expand Down Expand Up @@ -1457,7 +1457,7 @@ def _register_listener(
CustomListener(
app_name=self.name,
ack_function=functions.pop(0),
lazy_functions=functions, # type:ignore[arg-type]
lazy_functions=functions, # type: ignore[arg-type]
matchers=listener_matchers,
middleware=listener_middleware,
auto_acknowledgement=auto_acknowledgement,
Expand Down
6 changes: 3 additions & 3 deletions slack_bolt/app/async_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ async def async_middleware_next():
self._framework_logger.debug(debug_checking_listener(listener_name))
if await listener.async_matches(req=req, resp=resp): # type: ignore[arg-type]
# run all the middleware attached to this listener first
(middleware_resp, next_was_not_called) = await listener.run_async_middleware(
middleware_resp, next_was_not_called = await listener.run_async_middleware(
req=req, resp=resp # type: ignore[arg-type]
)
if next_was_not_called:
Expand Down Expand Up @@ -1434,7 +1434,7 @@ def _init_context(self, req: AsyncBoltRequest):
# For AI Agents & Assistants
if is_assistant_event(req.body):
assistant = AsyncAssistantUtilities(
payload=to_event(req.body), # type:ignore[arg-type]
payload=to_event(req.body), # type: ignore[arg-type]
context=req.context,
thread_context_store=self._assistant_thread_context_store,
)
Expand Down Expand Up @@ -1495,7 +1495,7 @@ def _register_listener(
AsyncCustomListener(
app_name=self.name,
ack_function=functions.pop(0),
lazy_functions=functions, # type:ignore[arg-type]
lazy_functions=functions, # type: ignore[arg-type]
matchers=listener_matchers,
middleware=listener_middleware,
auto_acknowledgement=auto_acknowledgement,
Expand Down
18 changes: 9 additions & 9 deletions slack_bolt/middleware/assistant/assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ def thread_started(
self.build_listener(
listener_or_functions=func,
matchers=all_matchers,
middleware=middleware, # type:ignore[arg-type]
middleware=middleware, # type: ignore[arg-type]
)
)
return func
Expand Down Expand Up @@ -106,7 +106,7 @@ def user_message(
self.build_listener(
listener_or_functions=func,
matchers=all_matchers,
middleware=middleware, # type:ignore[arg-type]
middleware=middleware, # type: ignore[arg-type]
)
)
return func
Expand Down Expand Up @@ -145,7 +145,7 @@ def bot_message(
self.build_listener(
listener_or_functions=func,
matchers=all_matchers,
middleware=middleware, # type:ignore[arg-type]
middleware=middleware, # type: ignore[arg-type]
)
)
return func
Expand Down Expand Up @@ -184,7 +184,7 @@ def thread_context_changed(
self.build_listener(
listener_or_functions=func,
matchers=all_matchers,
middleware=middleware, # type:ignore[arg-type]
middleware=middleware, # type: ignore[arg-type]
)
)
return func
Expand Down Expand Up @@ -214,13 +214,13 @@ def _merge_matchers(
):
return [CustomListenerMatcher(app_name=self.app_name, func=primary_matcher)] + (
custom_matchers or []
) # type:ignore[operator]
) # type: ignore[operator]

@staticmethod
def default_thread_context_changed(save_thread_context: SaveThreadContext, payload: dict):
save_thread_context(payload["assistant_thread"]["context"])

def process( # type:ignore[return]
def process( # type: ignore[return]
self, *, req: BoltRequest, resp: BoltResponse, next: Callable[[], BoltResponse]
) -> Optional[BoltResponse]:
if self._thread_context_changed_listeners is None:
Expand Down Expand Up @@ -255,8 +255,8 @@ def build_listener(
middleware: Optional[List[Middleware]] = None,
base_logger: Optional[Logger] = None,
) -> Listener:
if isinstance(listener_or_functions, Callable): # type:ignore[arg-type]
listener_or_functions = [listener_or_functions] # type:ignore[list-item]
if isinstance(listener_or_functions, Callable): # type: ignore[arg-type]
listener_or_functions = [listener_or_functions] # type: ignore[list-item]

if isinstance(listener_or_functions, Listener):
return listener_or_functions
Expand All @@ -270,7 +270,7 @@ def build_listener(
for matcher in matchers:
if isinstance(matcher, ListenerMatcher):
listener_matchers.append(matcher)
elif isinstance(matcher, Callable): # type:ignore[arg-type]
elif isinstance(matcher, Callable): # type: ignore[arg-type]
listener_matchers.append(
build_listener_matcher(
func=matcher,
Expand Down
26 changes: 13 additions & 13 deletions slack_bolt/middleware/assistant/async_assistant.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def thread_started(
func=is_assistant_thread_started_event,
asyncio=True,
base_logger=self.base_logger,
), # type:ignore[arg-type]
), # type: ignore[arg-type]
matchers,
)
if is_used_without_argument(args):
Expand All @@ -72,7 +72,7 @@ def thread_started(
self.build_listener(
listener_or_functions=func,
matchers=all_matchers,
middleware=middleware, # type:ignore[arg-type]
middleware=middleware, # type: ignore[arg-type]
)
)
return func
Expand Down Expand Up @@ -109,7 +109,7 @@ def user_message(
func=is_user_message_event_in_assistant_thread,
asyncio=True,
base_logger=self.base_logger,
), # type:ignore[arg-type]
), # type: ignore[arg-type]
matchers,
)
if is_used_without_argument(args):
Expand All @@ -118,7 +118,7 @@ def user_message(
self.build_listener(
listener_or_functions=func,
matchers=all_matchers,
middleware=middleware, # type:ignore[arg-type]
middleware=middleware, # type: ignore[arg-type]
)
)
return func
Expand Down Expand Up @@ -155,7 +155,7 @@ def bot_message(
func=is_bot_message_event_in_assistant_thread,
asyncio=True,
base_logger=self.base_logger,
), # type:ignore[arg-type]
), # type: ignore[arg-type]
matchers,
)
if is_used_without_argument(args):
Expand All @@ -164,7 +164,7 @@ def bot_message(
self.build_listener(
listener_or_functions=func,
matchers=all_matchers,
middleware=middleware, # type:ignore[arg-type]
middleware=middleware, # type: ignore[arg-type]
)
)
return func
Expand Down Expand Up @@ -201,7 +201,7 @@ def thread_context_changed(
func=is_assistant_thread_context_changed_event,
asyncio=True,
base_logger=self.base_logger,
), # type:ignore[arg-type]
), # type: ignore[arg-type]
matchers,
)
if is_used_without_argument(args):
Expand All @@ -210,7 +210,7 @@ def thread_context_changed(
self.build_listener(
listener_or_functions=func,
matchers=all_matchers,
middleware=middleware, # type:ignore[arg-type]
middleware=middleware, # type: ignore[arg-type]
)
)
return func
Expand Down Expand Up @@ -238,14 +238,14 @@ def _merge_matchers(
primary_matcher: Union[Callable[..., bool], AsyncListenerMatcher],
custom_matchers: Optional[Union[Callable[..., bool], AsyncListenerMatcher]],
):
return [primary_matcher] + (custom_matchers or []) # type:ignore[operator]
return [primary_matcher] + (custom_matchers or []) # type: ignore[operator]

@staticmethod
async def default_thread_context_changed(save_thread_context: AsyncSaveThreadContext, payload: dict):
new_context: dict = payload["assistant_thread"]["context"]
await save_thread_context(new_context)

async def async_process( # type:ignore[return]
async def async_process( # type: ignore[return]
self,
*,
req: AsyncBoltRequest,
Expand Down Expand Up @@ -284,8 +284,8 @@ def build_listener(
middleware: Optional[List[AsyncMiddleware]] = None,
base_logger: Optional[Logger] = None,
) -> AsyncListener:
if isinstance(listener_or_functions, Callable): # type:ignore[arg-type]
listener_or_functions = [listener_or_functions] # type:ignore[list-item]
if isinstance(listener_or_functions, Callable): # type: ignore[arg-type]
listener_or_functions = [listener_or_functions] # type: ignore[list-item]

if isinstance(listener_or_functions, AsyncListener):
return listener_or_functions
Expand All @@ -302,7 +302,7 @@ def build_listener(
else:
listener_matchers.append(
build_listener_matcher(
func=matcher, # type:ignore[arg-type]
func=matcher, # type: ignore[arg-type]
asyncio=True,
base_logger=base_logger,
)
Expand Down
1 change: 0 additions & 1 deletion slack_bolt/request/payload_utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from typing import Dict, Any, Optional


# ------------------------------------------
# Public Utilities
# ------------------------------------------
Expand Down
1 change: 0 additions & 1 deletion tests/scenario_tests/test_view_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
)
from tests.utils import remove_os_env_temporarily, restore_os_env


body = {
"type": "view_submission",
"team": {
Expand Down
1 change: 0 additions & 1 deletion tests/scenario_tests_async/test_view_submission.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
)
from tests.utils import remove_os_env_temporarily, restore_os_env


body = {
"type": "view_submission",
"team": {
Expand Down
Loading
Loading